forked from apache/accumulo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix apache#1514 Update pom.xml with log4j2 dependencies * Use slf4j bindings for log4j2 * Keep log4j 1.2 jars for minicluster and test, because ZK needs it at runtime * Use log4j-1.2-api jar for log4j 1.2 dependencies for deprecated public APIs that can't yet be removed (particularly in core/mapred stuffs) * Add disruptor jar to class path to support high-performance asynchronous loggers * Exclude transitive dependencies for log4j 1.2, for better control over build class path, and to avoid multiple runtime slf4j bindings * Update assembly to include log4j2 jars, and to exclude log4j 1.2 jars Fix apache#1515 Create new AccumuloMonitorAppender to send to REST endpoint * Remove unnecessary extra port configuration property for log4j SocketServer endpoint in monitor * Update Monitor to store HTTP(s) URL for the service in ZK instead of just host and port; remove redundant log4j service advertisement using old log4j SocketServer port * Create new AccumuloMonitorAppender to read HTTP(s) URL from ZooCache, on demand, and send logs as JSON to the REST endpoint at that URL * Fix extra slash in MonitorUtilTest * Replace previous LogService in monitor with simpler RecentLogs implementation to cache received logs from REST endpoint * Simplify LogResource REST endpoints to use the RecentLogs APIs, with new endpoint to receive POSTed logs as JSON, and clean up the deduplication/counting/sanitizing code * Simplify StatusResource to get its info from the RecentLogs object * Update the web views to include logger names on the monitor page, and to simplify passing of the optional stacktrace details Fix apache#1516 Remove log4j1 config files and add log4j2 config files * Create basic log4j2 config files for Accumulo services and a default config file for clients such as the shell * Update accumulo-env.sh to configure logging using high-performance asynchronous loggers * Create service config file with console, rolling file, and monitor appenders, as well as an example separate rolling file appender for audit logs that can be easily toggled on * Create config file for console suitable for clients, especially the shell, complete with color highlighting * Add config for periodic auto-reconfiguring of log4j without restarting services (especially helpful as a substitute for the now defunct shell option for 'debug on')
- Loading branch information
Showing
41 changed files
with
675 additions
and
1,078 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
## Log4j2 file that configures logging for all Accumulo services | ||
## The system properties referenced below are configured by accumulo-env.sh | ||
|
||
status = info | ||
dest = err | ||
name = AccumuloServiceLoggingProperties | ||
monitorInterval = 30 | ||
|
||
packages = org.apache.accumulo.monitor.util.logging | ||
|
||
property.filename = ${sys:accumulo.log.dir}/${sys:accumulo.application} | ||
|
||
appender.console.type = Console | ||
appender.console.name = STDERR | ||
appender.console.target = SYSTEM_ERR | ||
appender.console.layout.type = PatternLayout | ||
appender.console.layout.pattern = %d{ISO8601} [%-8c{2}] %-5p: %m%n | ||
appender.console.filter.threshold.type = ThresholdFilter | ||
appender.console.filter.threshold.level = info | ||
|
||
appender.rolling.type = RollingFile | ||
appender.rolling.name = LogFiles | ||
appender.rolling.fileName = ${filename}.log | ||
appender.rolling.filePattern = ${filename}-%d{MM-dd-yy-HH}-%i.log.gz | ||
appender.rolling.layout.type = PatternLayout | ||
appender.rolling.layout.pattern = %d{ISO8601} [%-8c{2}] %-5p: %m%n | ||
appender.rolling.policies.type = Policies | ||
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy | ||
appender.rolling.policies.time.interval = 1 | ||
appender.rolling.policies.time.modulate = true | ||
appender.rolling.policies.size.type = SizeBasedTriggeringPolicy | ||
appender.rolling.policies.size.size=100MB | ||
appender.rolling.strategy.type = DefaultRolloverStrategy | ||
appender.rolling.strategy.max = 10 | ||
|
||
appender.audit.type = RollingFile | ||
appender.audit.name = AuditLogFiles | ||
appender.audit.fileName = ${filename}.audit | ||
appender.audit.filePattern = ${filename}-%d{MM-dd-yy-HH}-%i.audit.gz | ||
appender.audit.layout.type = PatternLayout | ||
appender.audit.layout.pattern = %d{ISO8601} [%-8c{2}] %-5p: %m%n | ||
appender.audit.policies.type = Policies | ||
appender.audit.policies.time.type = TimeBasedTriggeringPolicy | ||
appender.audit.policies.time.interval = 1 | ||
appender.audit.policies.time.modulate = true | ||
appender.audit.policies.size.type = SizeBasedTriggeringPolicy | ||
appender.audit.policies.size.size=100MB | ||
appender.audit.strategy.type = DefaultRolloverStrategy | ||
appender.audit.strategy.max = 10 | ||
|
||
appender.monitor.type = AccumuloMonitor | ||
appender.monitor.name = MonitorLog | ||
appender.monitor.filter.threshold.type = ThresholdFilter | ||
appender.monitor.filter.threshold.level = warn | ||
|
||
logger.zookeeper.name = org.apache.zookeeper | ||
logger.zookeeper.level = error | ||
|
||
# uncomment for separate audit logs | ||
#logger.audit.name = org.apache.accumulo.audit | ||
#logger.audit.level = info | ||
#logger.audit.additivity = false | ||
#logger.audit.appenderRef.audit.ref = AuditLogFiles | ||
|
||
rootLogger.level = debug | ||
rootLogger.appenderRef.console.ref = STDERR | ||
rootLogger.appenderRef.rolling.ref = LogFiles | ||
rootLogger.appenderRef.monitor.ref = MonitorLog | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
## Log4j2 file that configures logging for processes other than Accumulo services | ||
|
||
status = info | ||
dest = err | ||
name = AccumuloDefaultLoggingProperties | ||
monitorInterval = 30 | ||
|
||
appender.console.type = Console | ||
appender.console.name = STDERR | ||
appender.console.target = SYSTEM_ERR | ||
appender.console.layout.type = PatternLayout | ||
appender.console.layout.pattern = %style{%d{ISO8601}}{dim,cyan} %style{[}{red}%style{%-8c{2}}{dim,blue}%style{]}{red} %highlight{%-5p}%style{:}{red} %m%n | ||
|
||
logger.shellaudit.name = org.apache.accumulo.shell.Shell.audit | ||
logger.shellaudit.level = warn | ||
|
||
logger.zookeeper.name = org.apache.zookeeper | ||
logger.zookeeper.level = error | ||
|
||
rootLogger.level = info | ||
rootLogger.appenderRef.console.ref = STDERR | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.