arjunek1992 | f6353d4 | 2018-11-20 08:56:29 -0500 | [diff] [blame] | 1 | ################################################################################ |
| 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 |
| 21 | color.fatal = bright red |
| 22 | color.error = bright red |
| 23 | color.warn = bright yellow |
| 24 | color.info = bright green |
| 25 | color.debug = cyan |
| 26 | color.trace = cyan |
| 27 | |
| 28 | # Common pattern layout for appenders |
| 29 | log4j2.pattern = %d{ISO8601} | %-5p | %-16t | %-32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n |
Carmelo Cascone | dc97192 | 2019-04-22 14:45:09 -0700 | [diff] [blame] | 30 | log4j2.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 |
arjunek1992 | f6353d4 | 2018-11-20 08:56:29 -0500 | [diff] [blame] | 31 | |
| 32 | |
| 33 | # Root logger |
| 34 | log4j2.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 |
| 38 | log4j2.rootLogger.appenderRef.RollingFile.ref = RollingFile |
arjunek1992 | f6353d4 | 2018-11-20 08:56:29 -0500 | [diff] [blame] | 39 | log4j2.rootLogger.appenderRef.PaxOsgi.ref = PaxOsgi |
| 40 | log4j2.rootLogger.appenderRef.Console.ref = Console |
| 41 | log4j2.rootLogger.appenderRef.Console.filter.regex.type = RegexFilter |
| 42 | log4j2.rootLogger.appenderRef.Console.filter.regex.regex = .*Audit.* |
| 43 | log4j2.rootLogger.appenderRef.Console.filter.regex.onMatch = DENY |
Daniele Moro | 2752759 | 2020-02-03 23:33:55 -0800 | [diff] [blame] | 44 | log4j2.rootLogger.appenderRef.Console.filter.regex.onMismatch = ACCEPT |
arjunek1992 | f6353d4 | 2018-11-20 08:56:29 -0500 | [diff] [blame] | 45 | #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 |
| 51 | log4j2.logger.sshd.name = org.apache.sshd |
| 52 | log4j2.logger.sshd.level = INFO |
| 53 | |
| 54 | # Spifly logger |
| 55 | log4j2.logger.spifly.name = org.apache.aries.spifly |
| 56 | log4j2.logger.spifly.level = WARN |
| 57 | |
| 58 | # Security audit logger |
| 59 | log4j2.logger.audit.name = audit |
| 60 | log4j2.logger.audit.level = TRACE |
| 61 | log4j2.logger.audit.additivity = false |
| 62 | log4j2.logger.audit.appenderRef.AuditRollingFile.ref = AuditRollingFile |
| 63 | |
Arjun E K | 53a2008 | 2018-12-18 05:13:05 -0500 | [diff] [blame] | 64 | log4j2.logger.securityAudit.name = securityAudit |
| 65 | log4j2.logger.securityAudit.level = TRACE |
| 66 | log4j2.logger.securityAudit.additivity = false |
| 67 | log4j2.logger.securityAudit.appenderRef.AuditRollingFile.ref = AuditRollingFile |
| 68 | |
| 69 | log4j2.logger.karafAudit.name = karafAudit |
| 70 | log4j2.logger.karafAudit.level = TRACE |
| 71 | log4j2.logger.karafAudit.additivity = false |
| 72 | log4j2.logger.karafAudit.appenderRef.AuditRollingFile.ref = KarafRollingFile |
| 73 | |
arjunek1992 | f6353d4 | 2018-11-20 08:56:29 -0500 | [diff] [blame] | 74 | # Appenders configuration |
| 75 | |
| 76 | # Console appender not used by default (see log4j2.rootLogger.appenderRefs) |
| 77 | log4j2.appender.console.type = Console |
| 78 | log4j2.appender.console.name = Console |
| 79 | log4j2.appender.console.layout.type = PatternLayout |
| 80 | log4j2.appender.console.layout.pattern = ${log4j2.out.pattern} |
| 81 | |
arjunek1992 | f6353d4 | 2018-11-20 08:56:29 -0500 | [diff] [blame] | 82 | # Rolling file appender |
| 83 | log4j2.appender.rolling.type = RollingRandomAccessFile |
| 84 | log4j2.appender.rolling.name = RollingFile |
| 85 | log4j2.appender.rolling.filter.regex.type = RegexFilter |
| 86 | log4j2.appender.rolling.filter.regex.regex = .*AuditLog.* |
| 87 | log4j2.appender.rolling.filter.regex.onMatch = DENY |
Daniele Moro | 2752759 | 2020-02-03 23:33:55 -0800 | [diff] [blame] | 88 | log4j2.appender.rolling.filter.regex.onMismatch = ACCEPT |
arjunek1992 | f6353d4 | 2018-11-20 08:56:29 -0500 | [diff] [blame] | 89 | log4j2.appender.rolling.fileName = ${karaf.data}/log/karaf.log |
| 90 | log4j2.appender.rolling.filePattern = ${karaf.data}/log/karaf.log.%i |
| 91 | # uncomment to not force a disk flush |
| 92 | #log4j2.appender.rolling.immediateFlush = false |
| 93 | log4j2.appender.rolling.append = true |
| 94 | log4j2.appender.rolling.layout.type = PatternLayout |
| 95 | log4j2.appender.rolling.layout.pattern = ${log4j2.pattern} |
| 96 | log4j2.appender.rolling.policies.type = Policies |
| 97 | log4j2.appender.rolling.policies.size.type = SizeBasedTriggeringPolicy |
| 98 | log4j2.appender.rolling.policies.size.size = 16MB |
| 99 | |
| 100 | # Audit file appender |
| 101 | log4j2.appender.audit.type = RollingRandomAccessFile |
| 102 | log4j2.appender.audit.name = AuditRollingFile |
| 103 | log4j2.appender.audit.fileName = ${karaf.data}/log/security.log |
| 104 | log4j2.appender.audit.filePattern = ${karaf.data}/log/security-%i.log |
| 105 | log4j2.appender.audit.append = true |
| 106 | log4j2.appender.audit.layout.type = PatternLayout |
| 107 | log4j2.appender.audit.layout.pattern = %m%n |
| 108 | log4j2.appender.audit.policies.type = Policies |
| 109 | log4j2.appender.audit.policies.size.type = SizeBasedTriggeringPolicy |
| 110 | log4j2.appender.audit.policies.size.size = 8MB |
| 111 | |
Arjun E K | 53a2008 | 2018-12-18 05:13:05 -0500 | [diff] [blame] | 112 | log4j2.appender.securityAudit.type = RollingRandomAccessFile |
| 113 | log4j2.appender.securityAudit.name = AuditRollingFile |
| 114 | log4j2.appender.securityAudit.fileName = ${karaf.data}/log/audit.log |
| 115 | log4j2.appender.securityAudit.filePattern = ${karaf.data}/log/audit-%i.log |
| 116 | log4j2.appender.securityAudit.append = true |
| 117 | log4j2.appender.securityAudit.layout.type = PatternLayout |
| 118 | log4j2.appender.securityAudit.layout.pattern = ${log4j2.pattern} |
| 119 | log4j2.appender.securityAudit.policies.type = Policies |
| 120 | log4j2.appender.securityAudit.policies.size.type = SizeBasedTriggeringPolicy |
| 121 | log4j2.appender.securityAudit.policies.size.size = 8MB |
| 122 | |
| 123 | log4j2.appender.karafAudit.type = RollingRandomAccessFile |
| 124 | log4j2.appender.karafAudit.name = KarafRollingFile |
| 125 | log4j2.appender.karafAudit.fileName = ${karaf.data}/log/karaf.log |
| 126 | log4j2.appender.karafAudit.filePattern = ${karaf.data}/log/karaf-%i.log |
| 127 | log4j2.appender.karafAudit.append = true |
| 128 | log4j2.appender.karafAudit.layout.type = PatternLayout |
| 129 | log4j2.appender.karafAudit.layout.pattern = ${log4j2.pattern} |
| 130 | log4j2.appender.karafAudit.policies.type = Policies |
| 131 | log4j2.appender.karafAudit.policies.size.type = SizeBasedTriggeringPolicy |
| 132 | log4j2.appender.karafAudit.policies.size.size = 8MB |
| 133 | |
arjunek1992 | f6353d4 | 2018-11-20 08:56:29 -0500 | [diff] [blame] | 134 | # OSGi appender |
| 135 | log4j2.appender.osgi.type = PaxOsgi |
| 136 | log4j2.appender.osgi.name = PaxOsgi |
| 137 | log4j2.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 Moro | 2752759 | 2020-02-03 23:33:55 -0800 | [diff] [blame] | 146 | |
| 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 |