Grails junk of debug logs

59 views Asked by At

log4j = {

appenders {
   'null' name:'stacktrace'
   environments {
        development {               
            rollingFile name: "appLog",
                        maxFileSize:'102400kB',
                        file: "./logs/tempAppLog.log",
                        layout:pattern(conversionPattern: '%d{[EEE, dd-MMM-yyyy @ HH:mm:ss.SSS]} [%t] %-5p %c %x - %m%n')
            root {
                debug 'appLog'
            }
        }
    }
}

error 'grails.app.service' //Service
error 'grails.app.controller' //  controllers
error 'com.demoapp'

info 'grails.app.service'
info 'grails.app.controller'
info 'com.demoapp'

debug 'grails.app.service'
debug 'grails.app.controller'
debug 'com.demoapp'

}

  • Here using above configuration it writes lots of debug logs inside tempAppLog.log which all having no use. I only want my package level debug logs. I am using grails 2.2.1 version.

Please help me to avoid unused logs to be written in file, only package specific logs should be written in file.

Thanks.

1

There are 1 answers

1
Yu Jiaao On

change the

   root {
            debug 'appLog'
        }

to

   root {
            error 'appLog'
        }

may be help you