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

Scriptrunner Behaviour not writing logs?

Yen-Wu Lo July 7, 2020

'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

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2020

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)
0 votes
Yen-Wu Lo August 30, 2020
TAGS
AUG Leaders

Atlassian Community Events