Change the rotation file size for Jira server logs
Purpose
The atlassian-jira.log as others logs inside the jira-home directory, automatically rotates by size after 20mb as default. Increasing its size could be necessary in some scenarios to retain more information.
Solution
Jira 9.4 and below:
You can check the file which is located at JIRA-INSTALL/atlassian-jira/WEB-INF/classes/log4j.properties and it should look something like this:
log4j.appender.xxxxxxxxlog=com.atlassian.jira.logging.JiraHomeAppender
log4j.appender.xxxxxxxxlog.File=atlassian-jira.log
log4j.appender.xxxxxxxxlog.MaxFileSize=20480KB
log4j.appender.xxxxxxxxlog.MaxBackupIndex=5
log4j.appender.xxxxxxxxlog.layout=com.atlassian.logging.log4j.NewLineIndentingFilteringPatternLayout
log4j.appender.xxxxxxxxlog.layout.ConversionPattern=%d %t %p %X{jira.username} %X{jira.request.id} %X{jira.request.assession.id} %X{jira.request.ipaddr} %X{jira.request.url} [%q{2}] %m%n
To increase or decrease the size that Jira will rotate the log file, change the log4j.appender.xxxxxxxxlog.MaxFileSize=20480KB.
Remember to restart Jira to the changes take effect.
As every log file will have its own section, pay attention while changing the parameters.
Jira 9.5 and above:
Please notice that as of Jira 9.5, log4j runtime library was upgraded to version 2.0:
https://confluence.atlassian.com/adminjiraserver/logging-and-profiling-938847671.html
The main change here is that instead of modifying log4j.properties, log4j2.xml file is now the new configuration file that needs to be modified. It resides under the same JIRA-INSTALL/atlassian-jira/WEB-INF/classes/ folder.
For the above quoted example, in order to change the log file size on Jira 9.5 and above, SizeBasedTriggeringPolicy value will need to be changed, on a per 'Appender' basis.
For example, to change atlassian-jira.log max size from the default 20Mb to 80Mb, locate the following section under log:
<JiraHomeAppender name="filelog"
fileName="atlassian-jira.log"
filePattern="atlassian-jira.log.%i">
<PatternLayout alwaysWriteExceptions="false">
<Pattern>${StackTraceFilteringPattern}</Pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="20480 KB"/>
</Policies>
<DefaultRolloverStrategy fileIndex="min" max="10"/>
</JiraHomeAppender>
Once located, change the "20480 KB" to "81920 KB", restart the application and the new setting should take affect.