How do I add logging to an Operation advisor plugin
Could anyone describe how to use some logging in operation participant plugins? Where and if to put dependencies to logging jars. Where is the logging configuration stored?
By logging I meam log4j framework, but if Jazz uses some other approach please let me know.
|
Accepted answer
Here is an example
import org.apache.commons.logging.LogFactory;
...
public class MyClass { private static final Log fgTraceLogger = LogFactory.getLog("com.ibm.example.logger");
public boolean isOK(boolean isOK) { if (!isOK) { fgTraceLogger.debug("Not OK!") } return isOK; }
--- Now you need to add the following to your log4j.properties file... log4j.logger.com.ibm.example.logger=DEBUG
After changing the log settings, the following url will reload log settings without reboot:
You may also need
# Default logging is for WARN and higher log4j.rootLogger=WARN, stdout, file
See also: https://jazz.net/wiki/bin/view/Deployment/ManipulatingCLMLog4j
Lawrence Smith [IBM] Ralph Schoon selected this answer as the correct answer
Comments
Aliaksei Gizheuski
commented May 30 '15, 1:12 p.m.
Oh, Thanks! I will give it a try. Great, thanks Lawrence!
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Could you change the summary to say something like "How do I add logging to an Operation advisor plugin"? Thanks.