Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes

Comments

Could you change the summary to say something like "How do I add logging to an Operation advisor plugin"? Thanks. 


Accepted answer

Permanent link
Here is an example

 import org.apache.commons.logging.Log;

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:
https://server:9443/jts/admin?internal=true#action=com.ibm.team.repository.admin.reloadLogging
(this is supposed to work but it didn't for me)


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

2 votes

Comments

 Oh, Thanks! I will give it a try.

Great, thanks Lawrence!

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,940

Question asked: May 30 '15, 11:55 a.m.

Question was seen: 2,553 times

Last updated: May 30 '15, 4:39 p.m.

Confirmation Cancel Confirm