ScriptRunner says "My first debug message!" twice

I'm running 

Groovy Script Runner 4.2, JIRA 7.1.0 from amps-standalone,  ATLAS Version:    6.2.2

I see:

2016-02-07 21:31:52,660 DEBUG [runner.ScriptRunnerImpl]: My first debug message!
2016-02-07 21:31:52,660 DEBUG [runner.ScriptRunnerImpl]: My first debug message!

 

I haven't modified this script, and I believe I've followed the instructions. Why might it be showing each log entry twice?

 

Here's tail amps-standalone/target/jira/webapp/WEB-INF/classes/log4j.properties 

 

# This one so it is in the UI and can be set
log4j.logger.net.sf.ehcache.distribution = ERROR, console, filelog, cloudAppender
log4j.additivity.logger.net.sf.ehcache.distribution = false
 
#
# Added to give more information on AO startup
#
log4j.logger.com.atlassian.activeobjects.osgi = DEBUG, console, filelog
log4j.additivity.com.atlassian.activeobjects.osgi = false
log4j.logger.com.onresolve = DEBUG, console, filelog

Thanks,

   Martin

1 answer

1 accepted

2 votes

You need to set the additivity to false, otherwise it gets logged by some parent logger as well (I presume). I think this is is missing from the instructions which I guess you followed.

So please try adding the follow lines:

log4j.logger.com.onresolve = DEBUG, filelog
log4j.additivity.com.onresolve = false

instead of the ones given. I will update the docn for the next release.

I stumpled upon this too.

But I have the problem that log.debug doesn´t work in classes I wrote and import into my script now. How can I solve this?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Tuesday in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

118 views 0 4
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