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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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