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

0 vote
Colin Goudie Community Champion Apr 25, 2013

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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

235 views 1 18
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