Skip to content

Commit

Permalink
OpenDataNode/open-data-node#257 - Evolveum#10 - logrotation and disab…
Browse files Browse the repository at this point in the history
…le logging into stdout
  • Loading branch information
Jan Marcek committed Jun 3, 2016
1 parent c4f0fb3 commit 23ead65
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/deb/etc/logrotate.d/odn-midpoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/odn-midpoint/* {
copytruncate
weekly
rotate 52
compress
missingok
create 640 odn-midpoint nogroup
}
68 changes: 68 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2010-2013 Evolveum
~
~ Licensed 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>
<appender name="IDM_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--See http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
<!--and http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy-->
<!--for further documentation-->
<Append>true</Append>
<File>${catalina.base}/logs/idm.log</File>
<encoder>
<pattern>%date [%X{subsystem}] [%thread] %level \(%logger\): %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${catalina.base}/logs/idm-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>10</maxHistory>
<cleanHistoryOnStart>true</cleanHistoryOnStart>
</rollingPolicy>
</appender>

<!-- Appender for profiling purposes -->
<appender name="IDM-PROFILE_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--See http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
<!--and http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy-->
<!--for further documentation-->
<Append>true</Append>
<File>${catalina.base}/logs/idm-profile.log</File>
<encoder>
<pattern>%date %level: %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${catalina.base}/logs/idm-profile-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>10</maxHistory>
</rollingPolicy>
</appender>
<!-- Appender for profiling purposes -->

<logger name="org.hibernate.engine.jdbc.spi.SqlExceptionHelper" level="OFF"/>
<logger name="org.hibernate.engine.jdbc.batch.internal.BatchingBatch" level="OFF"/>
<logger name="PROFILING" level="INFO"/>
<logger name="com.evolveum.midpoint" level="WARN" />
<logger name="com.evolveum.midpoint.web.util.MidPointProfilingServletFilter" level="TRACE">
<appender-ref ref="IDM-PROFILE_LOG"/>
</logger>
<root level="WARN">
<appender-ref ref="IDM_LOG"/>
</root>
</configuration>

0 comments on commit 23ead65

Please sign in to comment.