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:
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!
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
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")
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.
Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs