Project

General

Profile

Download (3.56 KB) Statistics
| Branch: | Tag: | Revision:
1
<!-- 
2
This is the default logging configuration file for the cdm-sever 
3
which  also serves as template for the test logging configuration.
4

    
5
The STDOUT should be disabled!!!!
6

    
7
Logback provides a system property variable (see ch.qos.logback.classic.util.ContextInitializer#CONFIG_FILE_PROPERTY) 
8
by which custom configuration files can be specified for production and test environments:
9

    
10
-Dlogback.configurationFile=file:/app/logback.xml
11

    
12
 -->
13
<configuration>
14
  <!-- address performance concern with jul-to-slf4j -->
15
  <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
16
    <resetJUL>true</resetJUL>
17
  </contextListener>
18

    
19
  <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
20
  
21
  <property name="LOG_FOLDER" value="${cdm.logDir}:-${user.home}/.cdmLibrary/log}" />
22
  <property name="ROLL_DAY" value="%d{yyyy-MM-dd}" />
23
  <property name="ROLL_MINUTE" value="%d{yyyy-MM-dd-mm}" />
24

    
25
  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
26
    <append>true</append>
27
    <file>${LOG_FOLDER}/cdm-server.log</file>
28
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
29
      <!-- daily rollover -->
30
      <fileNamePattern>${LOG_FOLDER}/cdm-server.${ROLL_DAY}.log.gz</fileNamePattern>
31
      <!-- keep 30 days' worth of history capped at 3GB total size -->
32
      <maxHistory>30</maxHistory>
33
      <totalSizeCap>3GB</totalSizeCap>
34
    </rollingPolicy>
35
    <encoder>
36
      <pattern>%d{HH:mm:ss.SSS} [%X{cdmInstance}] [%thread] %-5level %logger{36} - %msg%n</pattern>
37
    </encoder>
38
  </appender>
39

    
40
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
41
    <layout>
42
      <pattern>%d{HH:mm:ss.SSS} [%X{cdmInstance}] [%thread] %-5level %logger{36} - %msg%n</pattern>
43
    </layout>
44
  </appender>
45
  
46
  <!-- ~~~~~~ INFO level for all major components ~~~~~~ -->
47
  <logger name="org.eclipse.jetty" level="INFO" />
48
  <logger name="eu.etaxonomy.cdm.server" level="INFO" />
49
  <logger name="eu.etaxonomy.cdm" level="INFO" />
50
  
51
  <!-- ~~~~~~ "disabling" loggers unwanted at INFO level ~~~~~~ -->
52
  <!-- avoid vast amount of "getCitation not yet implemented" & "getProblems not yet implemented" messages -->
53
  <logger name="eu.etaxonomy.cdm.model.name.TaxonName" level="ERROR" />
54
  <logger name="eu.etaxonomy.cdm.persistence.dao.initializer" level="ERROR" />
55
  <logger name="eu.etaxonomy.cdm.cache.CdmTransientEntityCacher" level="WARN" />
56
  <logger name="eu.etaxonomy.cdm.remote.controller.interceptor" level="WARN" />
57
  <!-- prevent CdmExceptionResolver from logging errors -->
58
  <logger name="eu.etaxonomy.cdm.persistence.dao.initializer" level="ERROR" />
59
  <!-- json-lib -->
60
  <logger name="net.sf.json.JSONObject" level="ERROR" />
61
  <!-- Hibernate -->
62
  <logger name="org.hibernate" level="WARN" />
63
  <logger name="org.hibernate.search" level="ERROR" />
64
  <logger name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog" level="ERROR" />
65
  <!--  suppress HHH90000003 -->
66
  <logger name="org.hibernate.orm.deprecation" level="ERROR" />
67
  <!--  connection pool -->
68
  <logger name="com.mchange.v2.c3p0" level="WARN" />
69
  <!-- suppress nasty ehcache OutOfMemory warnings -->
70
  <logger name="net.sf.ehcache.config.CacheConfiguration" level="WARN" />
71
  
72
  <!-- ~~~~~~ logging of all requests to web service controllers with performance measures ~~~~~~ -->
73
  <logger name="eu.etaxonomy.cdm.api.remoting.DebuggingRemoteInvocationExecutor" level="DEBUG" />
74
  
75
  <!-- ~~~~~~ root logger ~~~~~~ -->
76
  <root level="WARN">
77
    <appender-ref ref="FILE" />
78
<!--  disabled for production : <appender-ref ref="STDOUT" /> -->
79
  </root>
80
</configuration>
(2-2/3)