Loggin Scripts

You can get a long with way with logging statements, which you can do by adjusting the log level, and “tailing” your log file, normally atlassian-jira.log (usually located in the path {JIRA_HOME}/log ).

Add the following lines to your log4j.properties (usually located in the path {TOMCAT_ROOT}/webapps/ROOT/WEB-INF/classes):


log4j.category.com.onresolve.jira.groovy = DEBUG, console, filelog
log4j.additivity.com.onresolve.jira.groovy = false

If your script fails for some reason a stack trace will be dumped in the logs.

Alternately, you can change the log levels without a restart from within your (groovy in this example) script:


import org.apache.log4j.Category

def Category log = Category.getInstance("com.onresolve.jira.groovy")
log.setLevel(org.apache.log4j.Level.DEBUG)
log.debug "debug statements"

And then in the Loggin & Profiling section in JIRA configure the com.onresolve.jira.groovy in DEBUG mode

groovy

Posted by:.

2 replies on “Configure Groovy ScriptRunner Logs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s