In a grails application I want to decorate each logs with custom data. The current need is simply to prepends the current user name to the log message
I've some idea about how to resolve this issue:
- Adding custom field to log4j patternLayout
- Using groovy's meta-class facilities to intercept each log call and modify the message content
I just want to have something easy to understand and to maintain: this is a very low priority feature so I don't want spending too much time messing around with it.
Any suggestion about a fast and easy way to implement this ?