Kindly help me to create my own log file for my jira plugin. Now i placed my log4j.properties file in src/main/resources and my rest api of jira plugin i wrote below code but it is not creating any log file inside
log folder. LOGGER.info(“calling getJiraActivity api”);
You would either have to update the log4j configuration within JIRA manually (or tell your users how to) OR update the configuration programatically (haven’t tested this one but found it on the google machine):
Word of caution though: If you’re doing this on a commercial add-on - your user base may care about log rotations etc so you’ll want to make sure you can configure that piece.
In my bitbucket server plugins I use logback. Create a component with a custom loggerfactory that scans the classpath for a logback.xml file. you’ll need to stop the appenders before you re-initialize or you’ll have an additional file every time your plugin is re-installed. I don’t have users so…
“A plugin specific log4j.properties file does not get picked up using this method once you deploy your plugin to another stand alone server. It only works using atlas-run or atlas-debug.”