In our implementation we are logging debug statements/requets/responses at various places. We do it from BasePageBean base class method which calls LogUtils ((this.log(“Sample text”)).
But the pattern printed by this statement doesnt print the class that is actually printing the log statement. This pattern is governed by “logging.properties” file. I changed the file to add %C and %L in the pattern like below:
log4j.message.pattern=%d{yyyy-MM-dd HH:mm:ss z} %x (%C : %L) - %m%n
But looks like this logging utility is kind of a wrapper class and the following class is printed always:
(com.webMethods.caf.faces.util.LogUtils : 129)- ..*. Test Logging statement
Generally logging libraries/wrappers allow us to pass a classname and level to the log() method such that the calling class and level can be controlled, however from what we can see here is even if we call LogUtils class directly we cannot pass classname of the calling class (only log level).
Per the javadocs of LogUtil, the log messages from that class go to a log category named “JSF”. If you want the log messages to go to a different category you would have to use a different logging API.