Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Scriptrunner advanced logging custom logger Edited

Hi, I made the settings described in the article https://scriptrunner.adaptavist.com/6.18.0/jira/advanced-logging.html step 2. And now scriptrunner logs writes to ScriptRunnerLogFile.log, but when I define custom logger in scriptrunner listener, for example 

import org.apache.log4j.Level
import org.apache.log4j.Logger

 

def log = Logger.getLogger("GetWorkflowStep")
log.setLevel(Level.DEBUG)

log.debug ("Test log")

the log is written to the standard atlassian-jira.log file, not to ScriptRunnerLogFile.log

So, what I did wrong?

Thanks

3 answers

2 accepted

I have a feeling that the documentation makes all logs that starts with com.onresolve to your ScriptRunnerLogFile.log file. This is due the log4j suggested changes they documented in their KB;

Can you try the following code?

import org.apache.log4j.Level
import org.apache.log4j.Logger


def log = Logger.getLogger("com.onresolve.GetWorkflowStep")
log.setLevel(Level.DEBUG)

log.debug ("Test log")

Hi there, 

I can confirm that changing your script from: 

def log = Logger.getLogger("GetWorkflowStep")

to:

def log = Logger.getLogger("com.onresolve.GetWorkflowStep")

will allow you to print your desired logs to the ScriptRunnerLogFile.log file instead of the atlassian-jira.log file. 

Please remember to restart your JIRA instance once you've made the above changes. 

Kind regards, 

Joe

Thanks guys, that was very helpful!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.13.0
TAGS
Community showcase
Posted in Jira Software

Presenting the "Best of 2020" Jira Software roundup!

Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...

7,171 views 8 28
Join discussion

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