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

This widget could not be displayed.

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
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

524 views 3 19
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