]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Add RollingFileAppender to default logback configuration 55/1455/2
authorjsimomaa <jani.simomaa@gmail.com>
Fri, 19 Jan 2018 11:32:48 +0000 (13:32 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 13 Feb 2018 20:44:32 +0000 (22:44 +0200)
refs #7719

Change-Id: I2e04f76b3b5ce13f984e796901bf76ac81f8766a
(cherry picked from commit f8324fc5a564f6eb45af8318471cb7197490f74e)

bundles/org.simantics.logback.configuration/logback.xml

index 0ff716fc993dd3a82b5c2a6b3815fa3a28169224..7f5a7081687f1818b1086c9e5e89eb5ca5db090d 100644 (file)
@@ -5,6 +5,21 @@
     <!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
     <encoder>
       <pattern>%-5p [%d] %c: %m%n%rEx</pattern>
+      <charset>UTF-8</charset>
+    </encoder>
+  </appender>
+
+  <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>logs/out.log</file>
+    <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+      <fileNamePattern>out-%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
+      <maxFileSize>10MB</maxFileSize>
+      <maxHistory>30</maxHistory>
+      <totalSizeCap>200MB</totalSizeCap>
+    </rollingPolicy>
+    <encoder>
+      <pattern>%-5p [%d] %c: %m%n%rEx</pattern>
+      <charset>UTF-8</charset>
     </encoder>
   </appender>
 
     <appender-ref ref="console" />
   </appender>
 
+  <appender name="async-file" class="ch.qos.logback.classic.AsyncAppender">
+    <appender-ref ref="file" />
+  </appender>
+
   <logger name="org.simantics" level="debug" additivity="false">
     <appender-ref ref="async-console" />
+    <appender-ref ref="async-file" />
   </logger>
 
   <root level="info">
     <appender-ref ref="async-console" />
+    <appender-ref ref="async-file" />
   </root>
 </configuration>
\ No newline at end of file