It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Change logfile at runtime without modifying config

Is it possible to change the location of the logfile created by custom scripts? I tried the following code without success:

import org.apache.log4j.Level
import org.apache.log4j.Logger
import org.apache.log4j.SimpleLayout
import org.apache.log4j.FileAppender

log.addAppender(new FileAppender(new SimpleLayout(),"qweasd.log",false))

I know that the docs mention that you can define a custom FileAppender in, but I need a way to do this at runtime. If it makes any difference, I tested this snippet using the script console of a local instance of Jira provided by the ScriptRunner sample application. Also, I am aware that it is possible to just create a File and write to that, but I'd very much prefer the comfort of log4j.

1 answer

1 accepted

0 votes
Answer accepted

The code I posted actually works. The issue was that scriptrunner-samples comes with a broken script-root-config which leads to the new log (and I suppose any other file you'd create as well) being created in


Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you