Separate log file for scriptrunner listener

Madhumitha September 8, 2022

Hello,

I have a Scriptrunner Listener which is doing a critical task and have bunch of script in it.

From https://docs.adaptavist.com/sr4js/latest/best-practices/logging/advanced-logging this document I have segregated the Scriptrunner log file.

 

But, as there are multiple behaviors, scripted fields etc. It is getting tough for me to find listener logs on that log file.

May I know if there is any option to write specific script listener logs to a separate file and other Scriptrunner feature (behaviors, fields etc..) logs to other file.

1 answer

0 votes

Hello!

I'm Olly from Adaptavist's ScriptRunner Support, this is certainly something I can assist with!

I would like to point out that our documentation has moved to https://docs.adaptavist.com/sr4js/latest

The page you've mentioned can be found here: https://docs.adaptavist.com/sr4js/latest/best-practices/logging/advanced-logging

To answer your question, I would recommend adding a log.warn message, such as:

log.warn "============= Listener 1 ===================="

Or perhaps a more useful identifying name at the start of each of your respective features, so you may clearly see which is being executed in the logs.

May I also add, that you can view the atlassian-jira.log file using our Built-In Script -> View Server Log Files!

Hope this answers your question!

Thanks,
Olly

Madhumitha September 8, 2022

Hello Olly,

Thanks for looking into the issue, I have updated the document link on question.

It would be more feasible for me to study listener logs if it has an independent file, will that be not possible?

At least for all script listeners together also works

Hello!

Since we're talking about Listeners, you can see the Execution History, which will also contain the log messages specifically for that one Listener being observed.

So essentially, in the Listener page you will see this:

execution-history-link.png

And within that History, you will see the Execution History:

execution-history-success.png

To further answer your question, it is possible to see a specific Feature's logs, however might be quite complicated and require custom coding.
We have a page in our Docs regarding Advanced Logging which I would suggest looking into if you would like to look into setting up your own logger.

Looking at the atlassian-jira.log, you can tell which feature a log entry came from based on the class name in square brackets before the message, but that's about as sophisticated as it gets.

Hope this answers your question!

Thanks,
Olly

Like Madhumitha likes this

Suggest an answer

Log in or Sign up to answer