Skip to content

Log4j2.xml

Easit GO uses the Apache Log4j version 2 framework for its logging. By default Easit GO looks for a file named log4j2.xml in the config directory, if no such file is found Easit GO defaults to a built in generic version of log4j2.xml. The standard log4j2.xml that is included in the installation package at downloadportal.easit.com looks as shown below. Feel free to copy and use this example if you need to.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Properties>
        <Property name="default-log-pattern">%d{yyyy-MM-dd HH:mm:ss.SSS}{CET} %-5level - %m [%c]%n</Property>
        <Property name="default-max-log-age">30</Property>
        <Property name="default-log-dir">${sys:bpeLogsPath}</Property>
        <Property name="default-log-name">EasitGO</Property>
    </Properties>
    <Appenders>
        <Console name="CONSOLE" 
                 target="SYSTEM_OUT">
            <PatternLayout pattern="${default-log-pattern}"/>
        </Console>
        <RollingFile name="DAILYFILE" 
                     fileName="${default-log-dir}/${default-log-name}.log"
                     filePattern="${default-log-dir}/${default-log-name}-%d{yyyy-MM-dd}.log">
            <PatternLayout pattern="${default-log-pattern}" 
                           charset="UTF-8"/>
            <Policies>
                <TimeBasedTriggeringPolicy interval="1"  
                                           modulate="true" />
            </Policies>
            <DefaultRolloverStrategy>
                <Delete basePath="${default-log-dir}"
                        maxDepth="1">
                    <IfFileName glob="${default-log-name}-*.log" />
                    <IfLastModified age="P${default-max-log-age}D" />
                </Delete>
            </DefaultRolloverStrategy>
        </RollingFile>
    </Appenders>

    <Loggers>
        <!-- Make hibernates ehcache warning logger use level ERROR to avoid filling
            log with this warning: "HHH020003: Could not find a specific ehcache configuration
            for cache named [...]" -->
        <Logger name="org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory"
                level="ERROR">
        </Logger>
        <!-- Make hibernates proxy warning logger use level ERROR to avoid filling
            log with this warning: "Narrowing proxy to class com.easit.exon.ItemTemplate
            - this operation breaks ==" -->
        <Logger name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog"
                level="ERROR">
        </Logger>
        <!-- Bug 49150: Since we handle org.hibernate.StaleStateException in a
            controlled fashion we do not want hibernate to fill the log with ERROR posts
            each time this happens. In the cases we let the exception fly it will be
            logged by ZK. -->
        <Logger name="org.hibernate.event.def.AbstractFlushingEventListener"
                level="ERROR">
        </Logger>

        <Logger name="org.hibernate.orm.deprecation" level="ERROR"/>

        <!-- Make Hibernates warning logger use level ERROR to avoid filling
            log with this warning: "HHH000179: Narrowing proxy to class ....." -->
        <Logger name="org.hibernate.engine.internal.StatefulPersistenceContext" level="ERROR"/>

        <Logger name="org.apache.solr.update.processor.LogUpdateProcessorFactory" level="ERROR"/>

        <Logger name="org.apache.solr.core.SolrCore.Request" level="ERROR"/>

        <Logger name="com.zaxxer.hikari" level="ERROR"/>

        <Logger name="org.ehcache.core.EhcacheManager" level="ERROR"/>

        <Logger name="org.ehcache.jsr107.Eh107CacheManager" level="ERROR"/>

        <Logger name="easit.go.started.logger" level="INFO"/>

        <Root level="WARN">
            <AppenderRef ref="DAILYFILE"/>
        </Root>
    </Loggers>
</Configuration>