Permana
2018-10-02 2429c55948869951cf10ffea42e8b79054e93068
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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 
    <property name="LOG_PATTERN"
              value='{"level":"%level","time":"%date","location":"%logger","method":"%M","message":%msg},%n'/>
    <springProfile name="dev">
        <property name="LOG_PATH" value="~/drive/amcloud/Project/ECOMMERS/payment_gateway/log/"/>
    </springProfile>
    <springProfile name="prod">
        <property name="LOG_PATH" value="/app1/am/app/unipin/log"/>
    </springProfile>
    <!-- Send debug messages to System.out -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!-- By default, encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
        <encoder>
            <pattern>${LOG_PATTERN}</pattern>
        </encoder>
    </appender>
 
    <!-- Send debug message to file -->
    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${LOG_PATH}/unipin-cms-service-unipin.log</file>
 
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>${LOG_PATTERN}</pattern>
        </encoder>
 
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${LOG_PATH}/cms/unipin-cms-service-unipin-%i-%d{yyyyMMdd}.log</fileNamePattern>
 
            <!-- each file should be at most 10MB, keep 90 days worth of history -->
            <maxHistory>90</maxHistory>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <maxFileSize>10MB</maxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
    </appender>
 
    <root level="INFO">
        <springProfile name="dev">
            <appender-ref ref="STDOUT"/>
        </springProfile>
        <springProfile name="prod">
            <appender-ref ref="FILE"/>
            <appender-ref ref="DB"/>
        </springProfile>
    </root>
</configuration>