blob: 88688aa0f21eef94dde4296f6fc152145c49c92b [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
30log4j2.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[%t]\u001b[0m %msg%n%throwable
31
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
39log4j2.rootLogger.appenderRef.AuditFile.ref = AuditFile
40log4j2.rootLogger.appenderRef.PaxOsgi.ref = PaxOsgi
41log4j2.rootLogger.appenderRef.Console.ref = Console
42log4j2.rootLogger.appenderRef.Console.filter.regex.type = RegexFilter
43log4j2.rootLogger.appenderRef.Console.filter.regex.regex = .*Audit.*
44log4j2.rootLogger.appenderRef.Console.filter.regex.onMatch = DENY
45log4j2.rootLogger.appenderRef.Console.filter.regex.onMisMatch = ACCEPT
46#log4j2.rootLogger.appenderRef.Console.filter.threshold.type = ThresholdFilter
47#log4j2.rootLogger.appenderRef.Console.filter.threshold.level = ${karaf.log.console:-OFF}
48
49# Loggers configuration
50
51# SSHD logger
52log4j2.logger.sshd.name = org.apache.sshd
53log4j2.logger.sshd.level = INFO
54
55# Spifly logger
56log4j2.logger.spifly.name = org.apache.aries.spifly
57log4j2.logger.spifly.level = WARN
58
59# Security audit logger
60log4j2.logger.audit.name = audit
61log4j2.logger.audit.level = TRACE
62log4j2.logger.audit.additivity = false
63log4j2.logger.audit.appenderRef.AuditRollingFile.ref = AuditRollingFile
64
65# Appenders configuration
66
67# Console appender not used by default (see log4j2.rootLogger.appenderRefs)
68log4j2.appender.console.type = Console
69log4j2.appender.console.name = Console
70log4j2.appender.console.layout.type = PatternLayout
71log4j2.appender.console.layout.pattern = ${log4j2.out.pattern}
72
73# Rest Audit file appender
74log4j2.appender.auditOnos.type = RollingRandomAccessFile
75log4j2.appender.auditOnos.name = AuditFile
76log4j2.appender.auditOnos.filter.regex.type = RegexFilter
77log4j2.appender.auditOnos.filter.regex.regex = .*AuditLog.*
78log4j2.appender.auditOnos.filter.regex.onMatch = ACCEPT
79log4j2.appender.auditOnos.filter.regex.onMisMatch = DENY
80log4j2.appender.auditOnos.fileName = ${karaf.data}/log/audit.log
81log4j2.appender.auditOnos.filePattern = ${karaf.data}/log/audit-%i.log
82log4j2.appender.auditOnos.append = true
83log4j2.appender.auditOnos.layout.type = PatternLayout
84log4j2.appender.auditOnos.layout.pattern = ${log4j2.pattern}
85log4j2.appender.auditOnos.policies.type = Policies
86log4j2.appender.auditOnos.policies.size.type = SizeBasedTriggeringPolicy
87log4j2.appender.auditOnos.policies.size.size = 8MB
88
89
90# Rolling file appender
91log4j2.appender.rolling.type = RollingRandomAccessFile
92log4j2.appender.rolling.name = RollingFile
93log4j2.appender.rolling.filter.regex.type = RegexFilter
94log4j2.appender.rolling.filter.regex.regex = .*AuditLog.*
95log4j2.appender.rolling.filter.regex.onMatch = DENY
96log4j2.appender.rolling.filter.regex.onMisMatch = ACCEPT
97log4j2.appender.rolling.fileName = ${karaf.data}/log/karaf.log
98log4j2.appender.rolling.filePattern = ${karaf.data}/log/karaf.log.%i
99# uncomment to not force a disk flush
100#log4j2.appender.rolling.immediateFlush = false
101log4j2.appender.rolling.append = true
102log4j2.appender.rolling.layout.type = PatternLayout
103log4j2.appender.rolling.layout.pattern = ${log4j2.pattern}
104log4j2.appender.rolling.policies.type = Policies
105log4j2.appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
106log4j2.appender.rolling.policies.size.size = 16MB
107
108# Audit file appender
109log4j2.appender.audit.type = RollingRandomAccessFile
110log4j2.appender.audit.name = AuditRollingFile
111log4j2.appender.audit.fileName = ${karaf.data}/log/security.log
112log4j2.appender.audit.filePattern = ${karaf.data}/log/security-%i.log
113log4j2.appender.audit.append = true
114log4j2.appender.audit.layout.type = PatternLayout
115log4j2.appender.audit.layout.pattern = %m%n
116log4j2.appender.audit.policies.type = Policies
117log4j2.appender.audit.policies.size.type = SizeBasedTriggeringPolicy
118log4j2.appender.audit.policies.size.size = 8MB
119
120# OSGi appender
121log4j2.appender.osgi.type = PaxOsgi
122log4j2.appender.osgi.name = PaxOsgi
123log4j2.appender.osgi.filter = *
124
125# help with identification of maven-related problems with pax-url-aether
126#log4j2.logger.aether.name = shaded.org.eclipse.aether
127#log4j2.logger.aether.level = TRACE
128#log4j2.logger.http-headers.name = shaded.org.apache.http.headers
129#log4j2.logger.http-headers.level = DEBUG
130#log4j2.logger.maven.name = org.ops4j.pax.url.mvn
131#log4j2.logger.maven.level = TRACE