Configure Bitbucket Server Logging


アトラシアン コミュニティをご利用ください。


It is sometimes useful for Bitbucket Server administrators to change the number of days logs are kept or the size of those individual log files. These sorts of modifications can be accomplished by editing the logback-spring.xml located in <Bitbucket Server Installation>/atlassian-bitbucket/WEB-INF/classes/logback-spring.xml

Bitbucket Server holds on to atlassian-bitbucket.log for 31 days by default. Similarly, atlassian-bitbucket-access.log files are kept for 10 days and they are in addition rotated through the day in case they reach 25MB. Any of these can be modified in the same way for any of the logs listed in the logback-spring.xml: by editing respectively the max_history variable and maxFileSize:

<Bitbucket Server Installation>/atlassian-bitbucket/WEB-INF/classes/logback-spring.xml
<appender name="bitbucket.application" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

<appender name="bitbucket.accesslog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">

In case you wanted to gzip any of the logs automatically on their rotation, you could change the line above and add .gz as an extension:




Lastly - it's also possible to adjust the output format of log messages that are written by each individual appender - such as changing the date format, or un-abbreviating the package names in each log entry. Check out this article for more information relating to these types of modifications.

  • As these files are maintained in the <Bitbucket Server Installation> directory, these changes will need to be re-applied manually when Bitbucket Server is upgraded
  • A Bitbucket Server restart after changes have been made is mandatory.
  • For versions of Bitbucket prior to 7.0, the file to modify will be named logback.xml instead of logback-spring.xml

最終更新日 2020 年 9 月 7 日


Powered by Confluence and Scroll Viewport.