Skip to content

Commit

Permalink
(PDB-3077) Include file size based rotation and disable logrotate
Browse files Browse the repository at this point in the history
This commit adds file-size based rotation to the main puppetdb and
puppetdb access log files and disables the use of logrotate for rotation
during ezbake package builds.
  • Loading branch information
camlow325 authored and Ryan Senior committed Oct 25, 2016
1 parent 4fa19f4 commit bc15789
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
:group "puppetdb"
:build-type "foss"
:main-namespace "puppetlabs.puppetdb.main"
:repo-target "PC1"}
:repo-target "PC1"
:logrotate-enabled false}
:config-dir "ext/config/foss"
}

Expand Down
9 changes: 6 additions & 3 deletions resources/ext/config/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

<appender name="F1" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/var/log/puppetlabs/puppetdb/puppetdb.log</file>

<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>/var/log/puppetlabs/puppetdb/puppetdb-%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>/var/log/puppetlabs/puppetdb/puppetdb-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- each file should be at most 10MB, keep 90 days worth of history, but at most 1GB total-->
<maxFileSize>10MB</maxFileSize>
<maxHistory>90</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d %-5p [%c{2}] %m%n</pattern>
Expand Down
10 changes: 9 additions & 1 deletion resources/ext/config/request-logging.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<configuration debug="false">
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/var/log/puppetlabs/puppetdb/puppetdb-access.log</file>
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>/var/log/puppetlabs/puppetdb/puppetdb-access-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- each file should be at most 10MB, keep 90 days worth of history, but at most 1GB total-->
<maxFileSize>10MB</maxFileSize>
<maxHistory>90</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%h %l %u [%t] "%r" %s %b "%i{Referer}" "%i{User-Agent}" %D</pattern>
</encoder>
Expand Down

0 comments on commit bc15789

Please sign in to comment.