Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set a default Log Level for MyPlugin in JIRA

Marcelo Mella
Contributor
October 1, 2020

I know that i have to go to Logging and profiling to set the log level of my plugin.

But, that only works until i restart Jira.

To make it permanent, i should change log4j.properties

 

But how can i define a default log level for my Plugin in my code?

Is it posible to define the log level every time the Plugin is Installed and/or Loaded?

To be more precise, is it posible to do something like:

@Override
public void afterPropertiesSet() throws Exception {
  System.out.println("Enabling plugin");
  def log = Logger.getLogger("com.example.myplugin");
  log.setLevel(Level.WARN);
  eventPublisher.register(this);
}

 

0 answers

Suggest an answer

Log in or Sign up to answer