asking this as an experiences Log4j user:
We have a pretty big class with lots of debug statements (Logger.getLogger(class).debug("Borrowed connection "+con.getId()
)... you know what I mean :)
Now 开发者_运维知识库I suspect one specific function to not work as expected and I want only this one particular function to log the debug output, the rest of the Class should keep the "error" level.
is there a solution to this? Google wouldn't satisfy my this time :)
You could use an own loger per method even though that may be a little inconvenient.
Logger.getLogger(class.getName()+"#methodName").debug(..)
will allow to define the log lever per method.
精彩评论