I am new to script runner and learning custom listeners. Trying this basic code to write log for all issue events under a particular project but when the script executes no logs are written. Am I doing something wrong or checking at the wrong place for the logs?
package com.gt.jira.listeners
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.event.issue.AbstractIssueEventListener
import org.apache.log4j.Category
class ExampleListener extends AbstractIssueEventListener {
Category log = Category.getInstance(ExampleListener.class)
@Override
void workflowEvent(IssueEvent event) {
log.debug "Event: ${event.getEventTypeId()}
fired for ${event.issue} and caught by ExampleListener"
}
}
Successfully executed
Listener configuration.
the simpliest solution is to use log.error instead of log.debug because debug is not logged by default or you have to set to logging level...it is described here https://www.adaptavist.com/doco/plugins/servlet/mobile?contentId=11993359#content/view/11993359
Sorry, I should have mentioned. I have tried info, warning and error but none of them are showing the output. Not sure if I am looking at the wrong place for the logs. I have checked atlassian_jira.log file as well for entires but no luck.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sainath Bavugi I did some tests and you have to use fully quallified name of the class instead of "path" to your script, so replace
If you will use log.error you should see it in your log files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great :), it was pleassure to help you :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.