Debugging or logging a custom service

How can I debug or log my own Jira service?

I am developping in eclipse and when I am debugging my JUnit test, I get the error "ComponentAccessor has not been initialised.". I tried to log: "Logger.getInstance(getClass()).error(e.getMessage());".

2 answers

1 accepted

This widget could not be displayed.

If you are using log4j or slf4j you will need a log4j.properties (or xml) in your src/test/resources path so it knows how to log

I want to log while the service is running within Jira.

Actually there is logged:

2013-04-26 10:56:48,878 QuartzWorker-1 DEBUG ServiceRunner [atlassian.jira.service.ServiceRunner] Running Service [Container: main.java.com.me.services.MyService delay [60000ms]]
2013-04-26 10:56:48,894 QuartzWorker-1 ERROR ServiceRunner MyService [com.me.services.MyService]
2013-04-26 10:56:48,894 QuartzWorker-1 DEBUG ServiceRunner [atlassian.jira.service.ServiceRunner] Finished Running Service [Container: main.java.com.me.services.MyService delay [60000ms]]

This widget could not be displayed.

I want to log while the service is running within Jira.

Actually there is logged:

2013-04-26 10:56:48,878 QuartzWorker-1 DEBUG ServiceRunner [atlassian.jira.service.ServiceRunner] Running Service [Container: main.java.com.me.services.MyService delay [60000ms]]
2013-04-26 10:56:48,894 QuartzWorker-1 ERROR ServiceRunner MyService [com.me.services.MyService]
2013-04-26 10:56:48,894 QuartzWorker-1 DEBUG ServiceRunner [atlassian.jira.service.ServiceRunner] Finished Running Service [Container: main.java.com.me.services.MyService delay [60000ms]]

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

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...

167 views 1 3
Join discussion

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