dberansky
January 9th, 2007, 11:46 AM
Just like many other developers we are using log4xx tool for our logging needs. Recently a new requirement has come up that for some debugging messages at certain times we want to log the stack trace at the time of the logging call. It looks like there are two ways I can implement this functionality:
1. create a wrapper on top of the log4xx library that would create the stack trace and add it to the message.
2. create a new log4xx specific layout decorator.
solution (1) has the advantage of being independent of the underlying logging implementation, when (2) would only work for log4xx, but my got feeling tells me that (2) is much cleaner (there is something I don't quite like about (1), but I don't know what it is).
Any thoughts?
1. create a wrapper on top of the log4xx library that would create the stack trace and add it to the message.
2. create a new log4xx specific layout decorator.
solution (1) has the advantage of being independent of the underlying logging implementation, when (2) would only work for log4xx, but my got feeling tells me that (2) is much cleaner (there is something I don't quite like about (1), but I don't know what it is).
Any thoughts?