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 Behaviour not writing logs? Edited

'm using the latest version of both Jira Service Desk Server and Scriptrunner.

I can write to the log file in the Scriptrunner console with

log.info("Test")

but when I put this in a behaviour initialiser it does not write to the same log file. Shouldn't it write to the log every time the request form is loaded?

 

Capture.PNG

2 answers

1 accepted

1 vote
Answer accepted

It writes to the same file... 

Here are 3 examples with the same 3 lines of code:

log.info "info"
log.debug "debug"
log.error "error"

In the console:

[...] url:/rest/scriptrunner/latest/user/exec/ username:p6s INFO p6s 916x226878x1 1latest/user/exec/ [c.o.scriptrunner.runner.ScriptBindingsManager] info
[...] url:/rest/scriptrunner/latest/user/exec/ username:p6s ERROR p6s 916x226878x1 /latest/user/exec/ [c.o.scriptrunner.runner.ScriptBindingsManager] error

In a behavior initializer (jira mapping)

[...] url:/rest/scriptrun...lidatorsByPid.json username:p6s INFO p6s 916x226866x1 1behaviours/latest/validatorsByPid.json [c.o.scriptrunner.runner.ScriptBindingsManager] info
[...] url:/rest/scriptrun...lidatorsByPid.json username:p6s ERROR p6s 916x226866x1 /behaviours/latest/validatorsByPid.json [c.o.scriptrunner.runner.ScriptBindingsManager] error 

In a behavior initializer (jsd mapping)

[...] url:/rest/scriptrun...lidatorsByPid.json username:p6s INFO p6s 919x227023x1 1behaviours/latest/jsd/jsd/validatorsByPid.json [c.o.scriptrunner.runner.ScriptBindingsManager] info
[...] url:/rest/scriptrun...lidatorsByPid.json username:p6s ERROR p6s 919x227023x1 /behaviours/latest/jsd/jsd/validatorsByPid.json [c.o.scriptrunner.runner.ScriptBindingsManager] error

All 3 log extracts came from atlassian-jira.log. I removed the date/time etc to keep the lines shorter.

Notice that the "debug" statements were not printed. That's because my log level for com.onresolve.scriptrunner.runner.ScriptBindingsManager is set to INFO. You can change from Loggin and Profiling.

Or using code:

log.setLevel(org.apache.log4j.Level.DEBUG)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Learn how to request and manage app requests in the Marketplace

G’day everyone! Super exciting news coming from the Marketplace. We have now fully rolled out the ability for end-users to submit app requests to admins directly from within the product! No longer ...

62 views 1 7
Read article

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