JIRA plugin logging - how?


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!

Regards, Sarah

3 answers

0 votes

You still have to explicitly write to the log - does your code run any

log.debug("I have a messinge, captin" );

type lines?

I do use log-methods like this:


I added this to all plugin methods, but no output anywhere :/

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,134 views 4 9
Read article

Atlassian User Groups

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!

Find my local user group

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

Groups near you