It's all about the answers!

Ask a question

How to write on system log


Michele Pegoraro (1.8k14118103) | asked Oct 12 '09, 5:42 a.m.
Hi,
how can I write some lines on log file /jazz/server/logs/jazz.log from plugin code on server side?

I'd like to use this way in order to catch possible not blocking problems for participants plugin.

One answer



permanent link
Patrick Streule (4.9k21) | answered Oct 12 '09, 2:17 p.m.
JAZZ DEVELOPER
how can I write some lines on log file /jazz/server/logs/jazz.log from
plugin code on server side?

I'd like to use this way in order to catch possible not blocking
problems for participants plugin.

If you are deriving from AbstractService, you can get access to the logger
using

Log log= getLog();

If you are implementing something else, you can also get a logger using

Log log= LogFactory.getLog(id);


To configure e.g. INFO level logging for your code, you would add a line
like this to log4j.properties:

log4j.logger.<id>=INFO

In the case of getLog() above, the id is the component id.

--
Regards,
Patrick
Jazz Work Item Team

Your answer


Register or to post your answer.