Hi,
I am developing a JIRA plugin and would like to be able to log something for debugging. I use the atlas-run JIRA runtime to test my plugin. I added a logger like this:
private static final Logger log = Logger.getLogger(MyCondition.class);
Then I enabled my logger in the JIRA administration (http://localhost:2990/jira/secure/admin/ViewLogging.jspa) with adding it like this:
my.package.MyCondition
and setting it to "DEBUG".
But I still get no output whatsoever - neither on the console nor in the atlassian-jira.log.
What am I doing wrong? Is there another way to log the output of a plugin in JIRA?
Thanks so much in advance!
Regards, Sarah
Look similar question: https://answers.atlassian.com/questions/74097/how-to-use-logging-from-inside-jira-plugins
And one of the official tutorial: https://developer.atlassian.com/display/JIRADEV/Writing+JIRA+event+listeners+with+the+atlassian-event+library
Sorry for digging corpses but I just came across a similar problem while writing a plugin for Confluence 4.3 with the plugin SDK 4.1.4.
This problem will occur when there's already a log4j.properties file in the <plugin-root>/target/container/tomcat6x/lib directory. If so, other properties files will be ignored.
The solution then is either to use this properties file or to just delete or better move it to the <plugin-root>/src/main/resources directory which should be the default dir for plugin projects - at least when compared to the settings in most tutorials.
Maybe this will safe someone some time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You still have to explicitly write to the log - does your code run any
log.debug("I have a messinge, captin" );
type lines?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, that's a good start - is your logging definitely in a place that it will be executed if the code is run?
I think you've got the system logging right (adding the package to the logging page and setting it to debug).
I have a feeling that you might want to add the logging in everywhere, including the constructor - I seem to remember that conditions and validators don't execute quite the way you'd expect, so it's worth adding extra logging to find out where they are actually being triggered. The logs should definitely go to atlassian-jira.log, but that can be very wordy, so I usually put in something distinctive (e.g. "Mr Flibble doesn't like this condition", then search the log for "Flibble")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.