Configure Stash Logging

'How Do I...' and 'How to...' Guide to Stash

このページの内容

お困りですか?

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

コミュニティに質問

It is sometimes useful for Stash 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.xml located in <Stash Installation>/atlassian-stash/WEB-INF/classes/logback.xml. These changes will need to be applied manually when Stash is upgraded.

Stash holds on to atlassian-stash.log for 31 days by default, but this can be changed by editing the max_history variable in this block of code:

atlassian-stash.log
<appender name="stash.application" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<charset>UTF-8</charset>
<pattern>${log.format}</pattern>
</encoder>
<file>${log.dir}/atlassian-stash.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.dir}/atlassian-stash-%d.log</fileNamePattern>
<maxHistory>31</maxHistory>
</rollingPolicy>
</appender>
{code}

atlassian-stash-access.log files are kept for 10 days, but this can be modified in the same way from this section of code:

atlassian-stash-access.log
<appender name="stash.accesslog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<charset>UTF-8</charset>
<pattern>${accesslog.format}</pattern>
</encoder>
<file>${log.dir}/atlassian-stash-access.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.dir}/atlassian-stash-access-%d.%i.log</fileNamePattern>
<maxHistory>10</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>25MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>

 

You can edit the individual file sizes using the maxFileSize variable for both types of logs. Make sure to restart Stash after changes have been made to ensure they take effect. 

最終更新日: 2016 年 2 月 23 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.