この投稿はまだメーリングリストに受け入れられていません。やあみんな、
助けを提供してくれてありがとう。ログをファイルに記録しようとすると問題が発生し、使用している構文の何が問題になっているのか理解できません。Config.groovyにログインするための設定は次のとおりです。
[SNIP]
log4j = {
// Example of changing the log pattern for the default console
// appender:
appenders {
// console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
file name: "scraperServiceLogger",
file: "target/scraperService.log"
}
error 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'
'grails.app.'
error scraperServiceLogger: "grails.app.service.ScraperService"
warn 'org.mortbay.log'
debug 'grails.test.*'
}
[/SNIP]
これが私のScraperService.groovy内でそれを使用しようとしている方法です:
[SNIP]
log.error "test"
[/SNIP]
書き込みたいファイルは正しく作成されていますが、ログインはコンソールにしか表示されません。どんな助けでも大歓迎です:)
ではごきげんよう。