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 votes
Accepted answer

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
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,946 views 19 22
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