ScriptRunner says "My first debug message!" twice

Martin Cleaver
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2016

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

3 votes
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2016

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.

Martin Cleaver
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 8, 2016

Thanks Jamie!

Holger Buhr February 25, 2016

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
TAGS
AUG Leaders

Atlassian Community Events