Project

General

Profile

Download (3.59 KB) Statistics
| Branch: | Tag: | Revision:
1
<!-- 
2
This is the test logging configuration for the cdm-sever which should be an exact copy of logback.xml
3
with the only difference that the STDOUT appender is being used instead of the FILE appender.
4

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

    
8
-Dlogback.configurationFile=file:/app/logback.xml
9

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

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

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

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