blob: c771aa998a23161762f5ba59dc521aa9e072ebde [file] [log] [blame]
arjunek1992f6353d42018-11-20 08:56:29 -05001################################################################################
2#
3# Licensed to the Apache Software Foundation (ASF) under one or more
4# contributor license agreements. See the NOTICE file distributed with
5# this work for additional information regarding copyright ownership.
6# The ASF licenses this file to You under the Apache License, Version 2.0
7# (the "License"); you may not use this file except in compliance with
8# the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18################################################################################
19
20# Colors for log level rendering
21color.fatal = bright red
22color.error = bright red
23color.warn = bright yellow
24color.info = bright green
25color.debug = cyan
26color.trace = cyan
27
28# Common pattern layout for appenders
29log4j2.pattern = %d{ISO8601} | %-5p | %-16t | %-32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
Carmelo Casconedc971922019-04-22 14:45:09 -070030log4j2.out.pattern = \u001b[90m%d{HH:mm:ss\.SSS}\u001b[0m %highlight{%-5level}{FATAL=${color.fatal}, ERROR=${color.error}, WARN=${color.warn}, INFO=${color.info}, DEBUG=${color.debug}, TRACE=${color.trace}} \u001b[90m[%c{1}]\u001b[0m %msg%n%throwable
arjunek1992f6353d42018-11-20 08:56:29 -050031
32
33# Root logger
34log4j2.rootLogger.level = INFO
35# uncomment to use asynchronous loggers, which require mvn:com.lmax/disruptor/3.3.2 library
36#log4j2.rootLogger.type = asyncRoot
37#log4j2.rootLogger.includeLocation = false
38log4j2.rootLogger.appenderRef.RollingFile.ref = RollingFile
arjunek1992f6353d42018-11-20 08:56:29 -050039log4j2.rootLogger.appenderRef.PaxOsgi.ref = PaxOsgi
40log4j2.rootLogger.appenderRef.Console.ref = Console
41log4j2.rootLogger.appenderRef.Console.filter.regex.type = RegexFilter
42log4j2.rootLogger.appenderRef.Console.filter.regex.regex = .*Audit.*
43log4j2.rootLogger.appenderRef.Console.filter.regex.onMatch = DENY
Daniele Morocc41a942020-02-03 23:33:55 -080044log4j2.rootLogger.appenderRef.Console.filter.regex.onMismatch = ACCEPT
arjunek1992f6353d42018-11-20 08:56:29 -050045#log4j2.rootLogger.appenderRef.Console.filter.threshold.type = ThresholdFilter
46#log4j2.rootLogger.appenderRef.Console.filter.threshold.level = ${karaf.log.console:-OFF}
47
48# Loggers configuration
49
50# SSHD logger
51log4j2.logger.sshd.name = org.apache.sshd
52log4j2.logger.sshd.level = INFO
53
54# Spifly logger
55log4j2.logger.spifly.name = org.apache.aries.spifly
56log4j2.logger.spifly.level = WARN
57
58# Security audit logger
59log4j2.logger.audit.name = audit
60log4j2.logger.audit.level = TRACE
61log4j2.logger.audit.additivity = false
62log4j2.logger.audit.appenderRef.AuditRollingFile.ref = AuditRollingFile
63
Arjun E K53a20082018-12-18 05:13:05 -050064log4j2.logger.securityAudit.name = securityAudit
65log4j2.logger.securityAudit.level = TRACE
66log4j2.logger.securityAudit.additivity = false
67log4j2.logger.securityAudit.appenderRef.AuditRollingFile.ref = AuditRollingFile
68
69log4j2.logger.karafAudit.name = karafAudit
70log4j2.logger.karafAudit.level = TRACE
71log4j2.logger.karafAudit.additivity = false
72log4j2.logger.karafAudit.appenderRef.AuditRollingFile.ref = KarafRollingFile
73
arjunek1992f6353d42018-11-20 08:56:29 -050074# Appenders configuration
75
76# Console appender not used by default (see log4j2.rootLogger.appenderRefs)
77log4j2.appender.console.type = Console
78log4j2.appender.console.name = Console
79log4j2.appender.console.layout.type = PatternLayout
80log4j2.appender.console.layout.pattern = ${log4j2.out.pattern}
81
arjunek1992f6353d42018-11-20 08:56:29 -050082# Rolling file appender
83log4j2.appender.rolling.type = RollingRandomAccessFile
84log4j2.appender.rolling.name = RollingFile
85log4j2.appender.rolling.filter.regex.type = RegexFilter
86log4j2.appender.rolling.filter.regex.regex = .*AuditLog.*
87log4j2.appender.rolling.filter.regex.onMatch = DENY
Daniele Morocc41a942020-02-03 23:33:55 -080088log4j2.appender.rolling.filter.regex.onMismatch = ACCEPT
arjunek1992f6353d42018-11-20 08:56:29 -050089log4j2.appender.rolling.fileName = ${karaf.data}/log/karaf.log
90log4j2.appender.rolling.filePattern = ${karaf.data}/log/karaf.log.%i
91# uncomment to not force a disk flush
92#log4j2.appender.rolling.immediateFlush = false
93log4j2.appender.rolling.append = true
94log4j2.appender.rolling.layout.type = PatternLayout
95log4j2.appender.rolling.layout.pattern = ${log4j2.pattern}
96log4j2.appender.rolling.policies.type = Policies
97log4j2.appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
98log4j2.appender.rolling.policies.size.size = 16MB
99
100# Audit file appender
101log4j2.appender.audit.type = RollingRandomAccessFile
102log4j2.appender.audit.name = AuditRollingFile
103log4j2.appender.audit.fileName = ${karaf.data}/log/security.log
104log4j2.appender.audit.filePattern = ${karaf.data}/log/security-%i.log
105log4j2.appender.audit.append = true
106log4j2.appender.audit.layout.type = PatternLayout
107log4j2.appender.audit.layout.pattern = %m%n
108log4j2.appender.audit.policies.type = Policies
109log4j2.appender.audit.policies.size.type = SizeBasedTriggeringPolicy
110log4j2.appender.audit.policies.size.size = 8MB
111
Arjun E K53a20082018-12-18 05:13:05 -0500112log4j2.appender.securityAudit.type = RollingRandomAccessFile
113log4j2.appender.securityAudit.name = AuditRollingFile
114log4j2.appender.securityAudit.fileName = ${karaf.data}/log/audit.log
115log4j2.appender.securityAudit.filePattern = ${karaf.data}/log/audit-%i.log
116log4j2.appender.securityAudit.append = true
117log4j2.appender.securityAudit.layout.type = PatternLayout
118log4j2.appender.securityAudit.layout.pattern = ${log4j2.pattern}
119log4j2.appender.securityAudit.policies.type = Policies
120log4j2.appender.securityAudit.policies.size.type = SizeBasedTriggeringPolicy
121log4j2.appender.securityAudit.policies.size.size = 8MB
122
123log4j2.appender.karafAudit.type = RollingRandomAccessFile
124log4j2.appender.karafAudit.name = KarafRollingFile
125log4j2.appender.karafAudit.fileName = ${karaf.data}/log/karaf.log
126log4j2.appender.karafAudit.filePattern = ${karaf.data}/log/karaf-%i.log
127log4j2.appender.karafAudit.append = true
128log4j2.appender.karafAudit.layout.type = PatternLayout
129log4j2.appender.karafAudit.layout.pattern = ${log4j2.pattern}
130log4j2.appender.karafAudit.policies.type = Policies
131log4j2.appender.karafAudit.policies.size.type = SizeBasedTriggeringPolicy
132log4j2.appender.karafAudit.policies.size.size = 8MB
133
arjunek1992f6353d42018-11-20 08:56:29 -0500134# OSGi appender
135log4j2.appender.osgi.type = PaxOsgi
136log4j2.appender.osgi.name = PaxOsgi
137log4j2.appender.osgi.filter = *
138
139# help with identification of maven-related problems with pax-url-aether
140#log4j2.logger.aether.name = shaded.org.eclipse.aether
141#log4j2.logger.aether.level = TRACE
142#log4j2.logger.http-headers.name = shaded.org.apache.http.headers
143#log4j2.logger.http-headers.level = DEBUG
144#log4j2.logger.maven.name = org.ops4j.pax.url.mvn
145#log4j2.logger.maven.level = TRACE
Daniele Morocc41a942020-02-03 23:33:55 -0800146
147# --- Example for a Kafka appender ---
148# Avoid recursive logging for Kafka
149# log4j2.logger.apacheKafka.name = org.apache.kafka
150# log4j2.logger.apacheKafka.level = INFO
151
152# Kafka appender definition
153# log4j2.appender.kafka.type = Kafka
154# log4j2.appender.kafka.name = Kafka
155# log4j2.appender.kafka.property.type = Property
156# log4j2.appender.kafka.property.name = bootstrap.servers
157# log4j2.appender.kafka.property.value = localhost:9092
158# log4j2.appender.kafka.topic = onos.log
159# Async send, no need to wait for Kafka ack for each record
160# log4j2.appender.kafka.syncSend = false
161# log4j2.kafka.pattern = {"@timestamp":"%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}","levelname":"%p","threadName":"%t","category":"%c{1}","bundle.id":"%X{bundle.id}","bundle.name":"%X{bundle.name}","bundle.version":"%X{bundle.version}","message":"%m"}%n
162# log4j2.appender.kafka.layout.type = PatternLayout
163# log4j2.appender.kafka.layout.pattern = ${log4j2.kafka.pattern}
164# log4j2.rootLogger.appenderRef.Kafka.ref = Kafka