blob: 4cd4b9b67860709ac8dc24c1b3bf4361d7dcaf62 [file] [log] [blame]
ramvermaaf74a622018-07-31 18:25:39 +01001//
2// ============LICENSE_START=======================================================
3// Copyright (C) 2016-2018 Ericsson. All rights reserved.
4// ================================================================================
5// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE
6// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode
7//
8// SPDX-License-Identifier: CC-BY-4.0
9// ============LICENSE_END=========================================================
10//
11// @author Sven van der Meer (sven.van.der.meer@ericsson.com)
12//
13
14== Standard Logging Configuration
15
16The standard logging configuration defines a context __APEX__, which is used in the standard output pattern.
liamfallona41c8772018-09-05 15:46:31 +010017The location for log files is defined in the property `VAR_LOG` and set to `/var/log/onap/policy/apex-pdp`.
ramvermaaf74a622018-07-31 18:25:39 +010018The standard status listener is set to __NOP__ and the overall logback configuration is set to no debug.
19
20[source%nowrap,xml,numbered]
21----
22<configuration debug="false">
23 <statusListener class="ch.qos.logback.core.status.NopStatusListener" />
24
25 <contextName>Apex</contextName>
liamfallona41c8772018-09-05 15:46:31 +010026 <property name="VAR_LOG" value="/var/log/onap/policy/apex-pdp/" />
ramvermaaf74a622018-07-31 18:25:39 +010027
28 ...appenders
29 ...loggers
30</configuration>
31----
32
33The first appender defined is called `STDOUT` for logs to standard out.
34
35[source%nowrap,xml,numbered]
36----
37<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
38 <encoder>
39 <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern>
40 </encoder>
41</appender>
42----
43
44The root level logger then is set to the level __info__ using the standard out appender.
45[source%nowrap,xml,numbered]
46----
47<root level="info">
48 <appender-ref ref="STDOUT" />
49</root>
50----
51
liamfallona41c8772018-09-05 15:46:31 +010052The second appender is called `FILE`.
ramvermaaf74a622018-07-31 18:25:39 +010053It writes logs to a file `apex.log`.
54[source%nowrap,xml,numbered]
55----
56<appender name="FILE" class="ch.qos.logback.core.FileAppender">
57 <file>${VAR_LOG}/apex.log</file>
58 <encoder>
liamfallona41c8772018-09-05 15:46:31 +010059 <pattern>%d %-5relative [procId=${processId}] [%thread] %-5level %logger{26} - %msg %n %ex{full}</pattern>
ramvermaaf74a622018-07-31 18:25:39 +010060 </encoder>
61</appender>
62----
63
liamfallona41c8772018-09-05 15:46:31 +010064The third appender is called `CTXT_FILE`.
ramvermaaf74a622018-07-31 18:25:39 +010065It writes logs to a file `apex_ctxt.log`.
66[source%nowrap,xml,numbered]
67----
68<appender name="CTXT_FILE" class="ch.qos.logback.core.FileAppender">
69 <file>${VAR_LOG}/apex_ctxt.log</file>
70 <encoder>
liamfallona41c8772018-09-05 15:46:31 +010071 <pattern>%d %-5relative [procId=${processId}] [%thread] %-5level %logger{26} - %msg %n %ex{full}</pattern>
ramvermaaf74a622018-07-31 18:25:39 +010072 </encoder>
73</appender>
74----
75
76The last definitions are for specific loggers.
liamfallona41c8772018-09-05 15:46:31 +010077The first logger captures all standard APEX classes.
78It is configured for log level __info__ and uses the standard output and file appenders.
79The second logger captures APEX context classes responsible for context monitoring.
80It is configured for log level __trace__ and uses the context file appender.
ramvermaaf74a622018-07-31 18:25:39 +010081
82[source%nowrap,xml,numbered]
83----
84<logger name="org.onap.policy.apex" level="info" additivity="false">
85 <appender-ref ref="STDOUT" />
86 <appender-ref ref="FILE" />
87</logger>
88
89<logger name="org.onap.policy.apex.core.context.monitoring" level="TRACE" additivity="false">
90 <appender-ref ref="CTXT_FILE" />
91</logger>
92----
93