Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.3.3
-
Fix Version/s: 3.0
-
Component/s: Configuration
-
Labels:None
Description
I think the current logging configuration is confusing, particularly for new users. Simplification would remove a major bugbear for users. Here's an initial proposal:
grails.logging = {
defaultLevel info // One of: off, error, warn, info, debug, trace
stdout = console format: "..."
stacktrace = rollingFile file: "..."
otherLog = socket ...
service debug, "reportService"
services warn, "securityService", "blogService"
controllers to: otherLog, trace, "postController", "userController"
web off // Grails web-related stuff
spring warn // Spring-related classes
gorm debug
packages to: stdout, info, "org.codehaus.groovy.grails", "grails.spring"
}
There was plenty of discussion about this on the developer mailing list:
http://grails.1312388.n4.nabble.com/Proposal-for-new-logging-DSL-td2288326.html
I'm raising this issue to see whether there is enough demand for this change. If the number of votes remains low, then it's not worth implementing, but if there are a lot of votes, we should consider making changes. This is also a good place to collate user feedback and suggestions on the proposal.
Issue Links
- is related to
-
GRAILS-6995
Drop commons logging API and use the native SLF4J one
-
I think there is a great convenience factor to having some of your suggested 'container' log settings for lack of a better word. I know from first hand experience that some of the frustration comes with trying to turn up the log level for your code - be it controller, service, etc. Coming from Java, I expected something like 'com.mycompany' to turn up the log level for my components, even though they were grails artifacts and have since learned that to achieve this effect I need to turn on 'grails.app.service/domain/etc'. This is an often cited source of confusion for many users. Perhaps in addition to making the DSL simpler, we could weave 'com.mycompany' into 'grails.app.service.com.mycompany' so that the users expected behavior would happen while keeping backwards compatibility?