No LOG output in Scriptrunner on Jira 8.20.1

Marko Slijepčević
Contributor
November 10, 2021

Hi,

Has anyone encountered with problems regarding log outputs in Scriptrunner on the latest long-term support release of Jira Server? No matter if in consoles or post functions, no logs are being displayed - I am using the following code snippet which has always worked for me and after upgrading to the latest version of Jira, Scriptrunner has stopped writing logs.

import org.apache.log4j.Logger
import org.apache.log4j.Level
def log = Logger.getLogger("Log:")
log.setLevel(Level.INFO)

log.info("Help")


I didn't find any information that org.apache.log4j.Logger has been Deprecated, am I missing something? The version of Scriptrunner we use is 6.38.0

Capture.PNG

 

BR

2 answers

0 votes
WW
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.
January 5, 2022

You could use:

def log = Logger.getLogger("com.acme.*")

instead of

def log = Logger.getLogger("Log:")

I don't know what "Log:" is.  Something about that looks off.

Also, unless I'm using the log inside of a class to be called from another script, I just use this one liner.  No need for anything else.  It's so much cleaner:

log.setLevel(org.apache.log4j.Level.INFO)
0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 10, 2021

Hi @Marko Slijepčević I did not encounter this issue but I'd check server log files. Can you do it? And what about logging error level? Did you try it?

Marko Slijepčević
Contributor
November 10, 2021

Hi @Martin Bayer _MoroSystems_ s_r_o__ 
I checked the server log files, nothing suspicious there. I have tried to log on all logging levels as well, but nothing happens at all.

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 11, 2021

Hm, this is weird, I just tested it on the same version of script runner and it works fine. I also tried to create new log appender https://scriptrunner.adaptavist.com/5.3.9/jira/recipes/misc/log-to-SR-file.html  but it always put the log to the log tab. I'm afraid I can't help with this :(

Suggest an answer

Log in or Sign up to answer