summaryrefslogtreecommitdiffstats
path: root/src/site-docs/adoc/fragments/howto-logging/example-server.adoc
blob: 8f40a42174f0e8b246a2c690e6f60899c24b57c9 (plain)
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
//
// ============LICENSE_START=======================================================
//  Copyright (C) 2016-2018 Ericsson. All rights reserved.
// ================================================================================
// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE
// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode
// 
// SPDX-License-Identifier: CC-BY-4.0
// ============LICENSE_END=========================================================
//
// @author Sven van der Meer (sven.van.der.meer@ericsson.com)
//

== Example Configuration for a Production Server

The following example shows a configuration that logs all APEX components, including policy logic, to a file (__debug__).
This configuration an be used in a production phase with the APEX engine being executed as a service on a system without console output.
This logback configuration is in the APEX installation as `logback-server.xml`

[source%nowrap,xml]
----
<configuration debug="false">
    <statusListener class="ch.qos.logback.core.status.NopStatusListener" />

    <contextName>Apex</contextName>
    <property name="VAR_LOG" value="/var/log/onap/policy/apex-pdp/" />

    <appender name="FILE" class="ch.qos.logback.core.FileAppender">
        <file>${VAR_LOG}/apex.log</file>
        <encoder>
            <pattern>
                %d %-5relative [procId=${processId}] [%thread] %-5level%logger{26} - %msg %n %ex{full}
            </pattern>
        </encoder>
    </appender>

    <root level="debug">
        <appender-ref ref="FILE" />
    </root>

    <logger name="org.onap.policy.apex.executionlogging" level="debug" additivity="false">
        <appender-ref ref="FILE" />
    </logger>
</configuration>
----