How to write in the JIRA logs from a plug-in?

Kinto Soft
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.
June 16, 2013

Hi,

I've added this dependency in my pom.xml (with the provided and the compile scope too):

<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.6.4</version>
			<scope>provided</scope>
		</dependency>

And from my Java classes:

private final static Logger log = LoggerFactory
			.getLogger(MyClass.class);

Unfortunatelly, it writes nothing in the JIRA log.

I've also tried to add my onw log4j configuration in the pom.xml:

<log4jProperties>src/main/resources/log/log4j.properties</log4jProperties>

and even it creates a new log file in the specified location, it is empty too.

Any ideas?

Thanks,

Pablo

2 answers

1 accepted

2 votes
Answer accepted
Andy Brook [Plugin People]
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.
June 16, 2013

Your project is fine, I think you havent enabled the package to be logged in JIRA (dont pack a log4j.properties file in your plugin, not useful). Go to Logging and Profiling, scroll down, add a custom package com.whatever, set it to DEBUG level, then you'll get logging output.

Kinto Soft
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.
June 16, 2013

dont pack a log4j.properties file in your plugin, not useful

Ok. I'll remove it from the pom.xml

Go to Logging and Profiling...

where??

Andy Brook [Plugin People]
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.
June 16, 2013

JIRA System Administration screen > Troubleshooting and Support > Logging and Profiling

Titus
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.
May 4, 2016

Can I add my own package or plugin programmatically and permanently to the section "Logging and Profiling"?

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 16, 2013

How are you making the log calls? You still need to rell it to put output into the log, with the various levels, and set those levels in your logging and profiling settings e.g.

log.debug("This will come out in the log if the log level is set to debug");

Kinto Soft
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.
June 16, 2013

I'm doing that with debug, info, warn and error. But nothing is shown in the logs...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events