Filippo Giunchedi has submitted this change and it was merged.

Change subject: cassandra: ship logback.xml with longer retention periods
......................................................................


cassandra: ship logback.xml with longer retention periods

rotate at 50MB instead of 20MB and keep 40 files instead of 20

Bug: T100970
Change-Id: I0b0f694947a4099f129b9b1833f0e00fadd18f9f
---
M manifests/init.pp
A templates/logback.xml.erb
2 files changed, 61 insertions(+), 0 deletions(-)

Approvals:
  Filippo Giunchedi: Verified; Looks good to me, approved
  Eevans: Looks good to me, but someone else must approve



diff --git a/manifests/init.pp b/manifests/init.pp
index bb7baa3..70e9b36 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -329,6 +329,14 @@
         require => Package['cassandra'],
     }
 
+    file { '/etc/cassandra/logback.xml':
+        content => template("${module_name}/logback.xml.erb"),
+        owner   => 'cassandra',
+        group   => 'cassandra',
+        mode    => '0444',
+        require => Package['cassandra'],
+    }
+
     # cassandra-rackdc.properties is used by the
     # GossipingPropertyFileSnitch.  Only render
     # it if we are using that endpoint_snitch.
diff --git a/templates/logback.xml.erb b/templates/logback.xml.erb
new file mode 100644
index 0000000..f2e2478
--- /dev/null
+++ b/templates/logback.xml.erb
@@ -0,0 +1,53 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<configuration scan="true">
+  <jmxConfigurator />
+  <appender name="FILE" 
class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${cassandra.logdir}/system.log</file>
+    <rollingPolicy 
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+      <fileNamePattern>${cassandra.logdir}/system.log.%i.zip</fileNamePattern>
+      <minIndex>1</minIndex>
+      <maxIndex>40</maxIndex>
+    </rollingPolicy>
+
+    <triggeringPolicy 
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>50MB</maxFileSize>
+    </triggeringPolicy>
+    <encoder>
+      <pattern>%-5level [%thread] %date{ISO8601} %F:%L - %msg%n</pattern>
+      <!-- old-style log format
+      <pattern>%5level [%thread] %date{ISO8601} %F (line %L) %msg%n</pattern>
+      -->
+    </encoder>
+  </appender>
+
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%-5level %date{HH:mm:ss,SSS} %msg%n</pattern>
+    </encoder>
+  </appender>
+
+  <root level="INFO">
+    <appender-ref ref="FILE" />
+    <appender-ref ref="STDOUT" />
+  </root>
+
+  <logger name="com.thinkaurelius.thrift" level="ERROR"/>
+</configuration>

-- 
To view, visit https://gerrit.wikimedia.org/r/219210
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b0f694947a4099f129b9b1833f0e00fadd18f9f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/cassandra
Gerrit-Branch: master
Gerrit-Owner: Filippo Giunchedi <fgiunch...@wikimedia.org>
Gerrit-Reviewer: Eevans <eev...@wikimedia.org>
Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org>
Gerrit-Reviewer: GWicke <gwi...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to