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
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
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

268 views 0 6
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