From 21d3307b7ba9575ff174165cb060b8be26619157 Mon Sep 17 00:00:00 2001 From: Rajan Dhabalia Date: Fri, 23 Feb 2018 10:49:37 -0800 Subject: [PATCH] Upgrade to log4j2 dependency and configuration (#680) * Add log4j2 dependency and configuration * add yamal configuration * Add more roll-over-file configuration + log4j2-web module --- .gitignore | 2 +- all/pom.xml | 28 ++++++++-- bin/bookkeeper | 10 ++-- bin/pulsar | 8 +-- bin/pulsar-admin | 8 +-- bin/pulsar-client | 8 +-- bin/pulsar-daemon | 4 +- bin/pulsar-perf | 8 +-- conf/log4j.properties | 73 -------------------------- conf/log4j.shell.properties | 39 -------------- conf/log4j2-scripts/filter.js | 33 ++++++++++++ conf/log4j2.yaml | 93 +++++++++++++++++++++++++++++++++ pom.xml | 41 +++++++++++++-- site/_data/cli/bookkeeper.yaml | 2 +- site/_data/cli/pulsar-perf.yaml | 2 +- site/_data/cli/pulsar.yaml | 2 +- 16 files changed, 213 insertions(+), 148 deletions(-) delete mode 100644 conf/log4j.properties delete mode 100644 conf/log4j.shell.properties create mode 100644 conf/log4j2-scripts/filter.js create mode 100644 conf/log4j2.yaml diff --git a/.gitignore b/.gitignore index 1e194b2a7fd28..dd1d1bf4ce035 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ dependency-reduced-pom.xml logs /data pulsar-broker/tmp.* -pulsar-broker/src/test/resources/log4j.properties +pulsar-broker/src/test/resources/log4j2.yaml *.log *.versionsBackup diff --git a/all/pom.xml b/all/pom.xml index deddfacdfc173..f4a65a5fcd719 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -65,13 +65,33 @@ - org.slf4j - slf4j-log4j12 + log4j + log4j - log4j - log4j + org.apache.logging.log4j + log4j-api + + + + org.apache.logging.log4j + log4j-core + + + + org.apache.logging.log4j + log4j-web + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + + org.apache.logging.log4j + log4j-slf4j-impl diff --git a/bin/bookkeeper b/bin/bookkeeper index 6e4ea2250f8ca..d2866c42bdd46 100755 --- a/bin/bookkeeper +++ b/bin/bookkeeper @@ -51,7 +51,7 @@ BINDIR=`dirname "$0"` BK_HOME=`cd $BINDIR/..;pwd` DEFAULT_CONF=$BK_HOME/conf/bookkeper.conf -DEFAULT_LOG_CONF=$BK_HOME/conf/log4j.properties +DEFAULT_LOG_CONF=$BK_HOME/conf/log4j2.yaml source $BK_HOME/conf/bkenv.sh @@ -146,7 +146,7 @@ COMMAND=$1 shift if [ $COMMAND == "shell" ]; then - DEFAULT_LOG_CONF=$BK_HOME/conf/log4j.shell.properties + DEFAULT_LOG_CONF=$BK_HOME/conf/log4j2.yaml fi if [ -z "$BOOKIE_CONF" ]; then @@ -159,7 +159,7 @@ fi BOOKIE_CLASSPATH="$BOOKIE_JAR:$BOOKIE_CLASSPATH:$BOOKIE_EXTRA_CLASSPATH" BOOKIE_CLASSPATH="`dirname $BOOKIE_LOG_CONF`:$BOOKIE_CLASSPATH" -OPTS="$OPTS -Dlog4j.configuration=`basename $BOOKIE_LOG_CONF`" +OPTS="$OPTS -Dlog4j.configurationFile=`basename $BOOKIE_LOG_CONF`" OPTS="-cp $BOOKIE_CLASSPATH $OPTS" @@ -169,12 +169,12 @@ OPTS="$OPTS $BOOKIE_EXTRA_OPTS" OPTS="$OPTS -Djava.net.preferIPv4Stack=true" # log directory & file -BOOKIE_ROOT_LOGGER=${BOOKIE_ROOT_LOGGER:-"INFO,CONSOLE"} +BOOKIE_LOG_APPENDER=${BOOKIE_LOG_APPENDER:-"Console"} BOOKIE_LOG_DIR=${BOOKIE_LOG_DIR:-"$BK_HOME/logs"} BOOKIE_LOG_FILE=${BOOKIE_LOG_FILE:-"bookkeeper-server.log"} #Configure log configuration system properties -OPTS="$OPTS -Dbookkeeper.root.logger=$BOOKIE_ROOT_LOGGER" +OPTS="$OPTS -Dpulsar.log.appender=$BOOKIE_LOG_APPENDER" OPTS="$OPTS -Dbookkeeper.log.dir=$BOOKIE_LOG_DIR" OPTS="$OPTS -Dbookkeeper.log.file=$BOOKIE_LOG_FILE" diff --git a/bin/pulsar b/bin/pulsar index 9309d8a53f034..ed7e988c8cd77 100755 --- a/bin/pulsar +++ b/bin/pulsar @@ -29,7 +29,7 @@ DEFAULT_DISCOVERY_CONF=$PULSAR_HOME/conf/discovery.conf DEFAULT_PROXY_CONF=$PULSAR_HOME/conf/proxy.conf DEFAULT_STANDALONE_CONF=$PULSAR_HOME/conf/standalone.conf DEFAULT_WEBSOCKET_CONF=$PULSAR_HOME/conf/websocket.conf -DEFAULT_LOG_CONF=$PULSAR_HOME/conf/log4j.properties +DEFAULT_LOG_CONF=$PULSAR_HOME/conf/log4j2.yaml if [ -f "$PULSAR_HOME/conf/pulsar_env.sh" ] then @@ -174,7 +174,7 @@ fi PULSAR_CLASSPATH="$PULSAR_JAR:$PULSAR_CLASSPATH:$PULSAR_EXTRA_CLASSPATH" PULSAR_CLASSPATH="`dirname $PULSAR_LOG_CONF`:$PULSAR_CLASSPATH" -OPTS="$OPTS -Dlog4j.configuration=`basename $PULSAR_LOG_CONF`" +OPTS="$OPTS -Dlog4j.configurationFile=`basename $PULSAR_LOG_CONF`" # Ensure we can read bigger content from ZK. (It might be # rarely needed when trying to list many z-nodes under a @@ -186,11 +186,11 @@ OPTS="-cp $PULSAR_CLASSPATH $OPTS" OPTS="$OPTS $PULSAR_EXTRA_OPTS" # log directory & file -PULSAR_ROOT_LOGGER=${PULSAR_ROOT_LOGGER:-"INFO,CONSOLE"} +PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"Console"} PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"} #Configure log configuration system properties -OPTS="$OPTS -Dpulsar.root.logger=$PULSAR_ROOT_LOGGER" +OPTS="$OPTS -Dpulsar.log.appender=$PULSAR_LOG_APPENDER" OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR" #Change to PULSAR_HOME to support relative paths diff --git a/bin/pulsar-admin b/bin/pulsar-admin index 516c5382ef6e9..8de438a785f70 100755 --- a/bin/pulsar-admin +++ b/bin/pulsar-admin @@ -22,7 +22,7 @@ BINDIR=$(dirname "$0") PULSAR_HOME=`cd $BINDIR/..;pwd` DEFAULT_CLIENT_CONF=$PULSAR_HOME/conf/client.conf -DEFAULT_LOG_CONF=$PULSAR_HOME/conf/log4j.properties +DEFAULT_LOG_CONF=$PULSAR_HOME/conf/log4j2.yaml if [ -f "$PULSAR_HOME/conf/pulsar_tools_env.sh" ] then @@ -88,7 +88,7 @@ fi PULSAR_CLASSPATH="$PULSAR_JAR:$PULSAR_CLASSPATH:$PULSAR_EXTRA_CLASSPATH" PULSAR_CLASSPATH="`dirname $PULSAR_LOG_CONF`:$PULSAR_CLASSPATH" -OPTS="$OPTS -Dlog4j.configuration=`basename $PULSAR_LOG_CONF`" +OPTS="$OPTS -Dlog4j.configurationFile=`basename $PULSAR_LOG_CONF`" OPTS="$OPTS -Djava.net.preferIPv4Stack=true" OPTS="-cp $PULSAR_CLASSPATH $OPTS" @@ -96,12 +96,12 @@ OPTS="-cp $PULSAR_CLASSPATH $OPTS" OPTS="$OPTS $PULSAR_EXTRA_OPTS" # log directory & file -PULSAR_ROOT_LOGGER=${PULSAR_ROOT_LOGGER:-"INFO,CONSOLE"} PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"} +PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"Console"} #Configure log configuration system properties -OPTS="$OPTS -Dpulsar.root.logger=$PULSAR_ROOT_LOGGER" OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR" +OPTS="$OPTS -Dpulsar.log.appender=$PULSAR_LOG_APPENDER" #Change to PULSAR_HOME to support relative paths cd "$PULSAR_HOME" diff --git a/bin/pulsar-client b/bin/pulsar-client index a89878af1162b..650322afd5fcb 100755 --- a/bin/pulsar-client +++ b/bin/pulsar-client @@ -22,7 +22,7 @@ BINDIR=$(dirname "$0") PULSAR_HOME=`cd $BINDIR/..;pwd` DEFAULT_CLIENT_CONF=$PULSAR_HOME/conf/client.conf -DEFAULT_LOG_CONF=$PULSAR_HOME/conf/log4j.shell.properties +DEFAULT_LOG_CONF=$PULSAR_HOME/conf/log4j2.yaml if [ -f "$PULSAR_HOME/conf/pulsar_tools_env.sh" ] then @@ -88,7 +88,7 @@ fi PULSAR_CLASSPATH="$PULSAR_JAR:$PULSAR_CLASSPATH:$PULSAR_EXTRA_CLASSPATH" PULSAR_CLASSPATH="`dirname $PULSAR_LOG_CONF`:$PULSAR_CLASSPATH" -OPTS="$OPTS -Dlog4j.configuration=`basename $PULSAR_LOG_CONF`" +OPTS="$OPTS -Dlog4j.configurationFile=`basename $PULSAR_LOG_CONF`" OPTS="$OPTS -Djava.net.preferIPv4Stack=true" OPTS="-cp $PULSAR_CLASSPATH $OPTS" @@ -96,12 +96,12 @@ OPTS="-cp $PULSAR_CLASSPATH $OPTS" OPTS="$OPTS $PULSAR_EXTRA_OPTS" # log directory & file -PULSAR_ROOT_LOGGER=${PULSAR_ROOT_LOGGER:-"INFO,CONSOLE"} PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"} +PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"Console"} #Configure log configuration system properties -OPTS="$OPTS -Dpulsar.root.logger=$PULSAR_ROOT_LOGGER" OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR" +OPTS="$OPTS -Dpulsar.log.appender=$PULSAR_LOG_APPENDER" #Change to PULSAR_HOME to support relative paths cd "$PULSAR_HOME" diff --git a/bin/pulsar-daemon b/bin/pulsar-daemon index 3658659d619f4..5853f112d625a 100755 --- a/bin/pulsar-daemon +++ b/bin/pulsar-daemon @@ -44,7 +44,7 @@ then fi PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"} -PULSAR_ROOT_LOGGER=${PULSAR_ROOT_LOGGER:-'INFO,ROLLINGFILE'} +PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"RollingFile"} PULSAR_STOP_TIMEOUT=${PULSAR_STOP_TIMEOUT:-30} PULSAR_PID_DIR=${PULSAR_PID_DIR:-$PULSAR_HOME/bin} @@ -90,7 +90,7 @@ case $command in esac export PULSAR_LOG_DIR=$PULSAR_LOG_DIR -export PULSAR_ROOT_LOGGER=$PULSAR_ROOT_LOGGER +export PULSAR_LOG_APPENDER=$PULSAR_LOG_APPENDER export PULSAR_LOG_FILE=pulsar-$command-$HOSTNAME.log pid=$PULSAR_PID_DIR/pulsar-$command.pid diff --git a/bin/pulsar-perf b/bin/pulsar-perf index 287012ba6db60..8226b7e0b4783 100755 --- a/bin/pulsar-perf +++ b/bin/pulsar-perf @@ -22,7 +22,7 @@ BINDIR=$(dirname "$0") PULSAR_HOME=`cd $BINDIR/..;pwd` DEFAULT_CLIENT_CONF=$PULSAR_HOME/conf/client.conf -DEFAULT_LOG_CONF=$PULSAR_HOME/conf/log4j.properties +DEFAULT_LOG_CONF=$PULSAR_HOME/conf/log4j2.yaml if [ -f "$PULSAR_HOME/conf/pulsar_env.sh" ] then @@ -117,18 +117,18 @@ fi PULSAR_CLASSPATH="$PULSAR_JAR:$PULSAR_CLASSPATH:$PULSAR_EXTRA_CLASSPATH" PULSAR_CLASSPATH="`dirname $PULSAR_LOG_CONF`:$PULSAR_CLASSPATH" -OPTS="$OPTS -Dlog4j.configuration=`basename $PULSAR_LOG_CONF` -Djava.net.preferIPv4Stack=true" +OPTS="$OPTS -Dlog4j.configurationFile=`basename $PULSAR_LOG_CONF` -Djava.net.preferIPv4Stack=true" OPTS="-cp $PULSAR_CLASSPATH $OPTS" OPTS="$OPTS $PULSAR_EXTRA_OPTS" # log directory & file -PULSAR_ROOT_LOGGER=${PULSAR_ROOT_LOGGER:-"INFO,CONSOLE"} +PULSAR_LOG_APPENDER=${PULSAR_LOG_APPENDER:-"Console"} PULSAR_LOG_DIR=${PULSAR_LOG_DIR:-"$PULSAR_HOME/logs"} PULSAR_LOG_FILE=${PULSAR_LOG_FILE:-"pulsar-perftest.log"} #Configure log configuration system properties -OPTS="$OPTS -Dpulsar.root.logger=$PULSAR_ROOT_LOGGER" +OPTS="$OPTS -Dpulsar.log.appender=$PULSAR_LOG_APPENDER" OPTS="$OPTS -Dpulsar.log.dir=$PULSAR_LOG_DIR" OPTS="$OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE" diff --git a/conf/log4j.properties b/conf/log4j.properties deleted file mode 100644 index 30156f8f28643..0000000000000 --- a/conf/log4j.properties +++ /dev/null @@ -1,73 +0,0 @@ -# -# 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. -# - -# Format is " (, )+ - -# DEFAULT: console appender only -# Define some default values that can be overridden by system properties -pulsar.root.logger=WARN,CONSOLE -pulsar.log.dir=logs -pulsar.log.file=pulsar.log - -log4j.rootLogger=${pulsar.root.logger} -log4j.logger.org.apache.zookeeper.server.ZooKeeperServer=WARN -log4j.logger.org.apache.zookeeper.ZooKeeper=WARN - -# Example with rolling log file -#log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE - -# Example with rolling log file and tracing -#log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE - -# -# Log INFO level and above messages to the console -# -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.Threshold=DEBUG -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n - -# -# Add ROLLINGFILE to rootLogger to get log file output -# Log DEBUG level and above messages to a log file -log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender - -log4j.appender.ROLLINGFILE.Threshold=DEBUG -log4j.appender.ROLLINGFILE.File=${pulsar.log.dir}/${pulsar.log.file} -log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n - -# Max log file size of 10MB -#log4j.appender.ROLLINGFILE.MaxFileSize=10MB -# uncomment the next line to limit number of backup files -#log4j.appender.ROLLINGFILE.MaxBackupIndex=10 - -log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n - -# -# Add TRACEFILE to rootLogger to get log file output -# Log DEBUG level and above messages to a log file -log4j.appender.TRACEFILE=org.apache.log4j.FileAppender -log4j.appender.TRACEFILE.Threshold=TRACE -log4j.appender.TRACEFILE.File=pulsar-trace.log - -log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout -### Notice we are including log4j's NDC here (%x) -log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L][%x] - %m%n diff --git a/conf/log4j.shell.properties b/conf/log4j.shell.properties deleted file mode 100644 index 146d153fcac0c..0000000000000 --- a/conf/log4j.shell.properties +++ /dev/null @@ -1,39 +0,0 @@ -# -# 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. -# - -# -# BookieShell configuration - -# DEFAULT: console appender only -# Define some default values that can be overridden by system properties -bookkeeper.root.logger=ERROR,CONSOLE - -log4j.rootLogger=${bookkeeper.root.logger} - -# -# Log INFO level and above messages to the console -# -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.Threshold=DEBUG -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p %m%n - -log4j.logger.org.apache.zookeeper=ERROR -log4j.logger.org.apache.bookkeeper=ERROR -log4j.logger.org.apache.bookkeeper.bookie.BookieShell=INFO diff --git a/conf/log4j2-scripts/filter.js b/conf/log4j2-scripts/filter.js new file mode 100644 index 0000000000000..ad3b4918494eb --- /dev/null +++ b/conf/log4j2-scripts/filter.js @@ -0,0 +1,33 @@ +/* + * 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. + */ +// This is a sample file which can be used by log4j2 to: only log debug-statement which has text: pulsar-topic-name +var result = false; +var topicName = "pulsar-topic-name"; +/* + * Find more logEvent attributes at : + * https://github.com/apache/logging-log4j2/blob/dbd2d252a1b4139a9bd9eb213c89f28498db6dcf/log4j-core/src/main/java/org/apache/logging/log4j/core/LogEvent.java + */ +if (logEvent.getLevel() == "DEBUG"){ + if(logEvent.getMessage().getFormattedMessage().indexOf(topicName)!=-1) { + result = true; + } +} else { + result = true; +} +result; \ No newline at end of file diff --git a/conf/log4j2.yaml b/conf/log4j2.yaml new file mode 100644 index 0000000000000..13b07adc92ee8 --- /dev/null +++ b/conf/log4j2.yaml @@ -0,0 +1,93 @@ +# +# 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. +# + + +Configuration: + status: INFO + monitorInterval: 30 + name: pulsar + + # Example: logger-filter script + Scripts: + ScriptFile: + name: filter.js + language: JavaScript + path: ./conf/log4j2-scripts/filter.js + charset: UTF-8 + + Appenders: + + # Console + Console: + name: Console + target: SYSTEM_OUT + PatternLayout: + Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" + + # Rolling file appender configuration + RollingFile: + name: RollingFile + fileName: "${sys:pulsar.log.dir}/${sys:pulsar.log.file}" + filePattern: "/${sys:pulsar.log.file}-%d{MM-dd-yyyy}-%i.log.gz" + immediateFlush: false + PatternLayout: + Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" + Policies: + TimeBasedTriggeringPolicy: + interval: 1 + modulate: true + SizeBasedTriggeringPolicy: + size: 1 GB + # Trigger every day at midnight that also scan + # roll-over strategy that deletes older file + CronTriggeringPolicy: + schedule: "0 0 0 * * ?" + # Delete file older than 30days + DefaultRolloverStrategy: + Delete: + basePath: ${sys:pulsar.log.dir} + maxDepth: 2 + IfFileName: + glob: "*/${sys:pulsar.log.file}*log.gz" + IfLastModified: + age: 30d + + + Loggers: + + # Default root logger configuration + Root: + level: info + additivity: false + AppenderRef: + ref: "${sys:pulsar.log.appender}" + + # Logger to inject filter script +# Logger: +# name: org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl +# level: debug +# additivity: false +# AppenderRef: +# ref: "${sys:pulsar.log.appender}" +# ScriptFilter: +# onMatch: ACCEPT +# onMisMatch: DENY +# ScriptRef: +# ref: filter.js + \ No newline at end of file diff --git a/pom.xml b/pom.xml index eb97e0bae0dfd..e7083547eaa71 100644 --- a/pom.xml +++ b/pom.xml @@ -118,6 +118,7 @@ flexible messaging model and an intuitive client API. 1.8.9 5.8.6 1.7.25 + 2.10.0 1.55 2.9.3 6.19 @@ -223,6 +224,12 @@ flexible messaging model and an intuitive client API. org.apache.bookkeeper.stats datasketches-metrics-provider ${bookkeeper.version} + + + slf4j-log4j12 + org.slf4j + + @@ -322,21 +329,45 @@ flexible messaging model and an intuitive client API. - slf4j-log4j12 org.slf4j + slf4j-simple ${slf4j.version} org.slf4j - slf4j-simple + jul-to-slf4j ${slf4j.version} - org.slf4j - jul-to-slf4j - ${slf4j.version} + org.apache.logging.log4j + log4j-api + ${log4j2.version} + + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j2.version} + + + + org.apache.logging.log4j + log4j-web + ${log4j2.version} + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + 2.5.0 diff --git a/site/_data/cli/bookkeeper.yaml b/site/_data/cli/bookkeeper.yaml index b14056e2fcd2e..dd44869b334c3 100644 --- a/site/_data/cli/bookkeeper.yaml +++ b/site/_data/cli/bookkeeper.yaml @@ -57,7 +57,7 @@ commands: env_vars: - name: BOOKIE_LOG_CONF description: Log4j configuration file - default: conf/log4j.properties + default: conf/log4j2.yaml - name: BOOKIE_CONF description: BookKeeper configuration file default: conf/bk_server.conf diff --git a/site/_data/cli/pulsar-perf.yaml b/site/_data/cli/pulsar-perf.yaml index 088a53bbd0a98..d6772ff80eb8c 100644 --- a/site/_data/cli/pulsar-perf.yaml +++ b/site/_data/cli/pulsar-perf.yaml @@ -131,7 +131,7 @@ commands: env_vars: - name: PULSAR_LOG_CONF description: Log4j configuration file - default: conf/log4j.properties + default: conf/log4j2.yaml - name: PULSAR_CLIENT_CONF description: Configuration file for the client default: conf/client.conf diff --git a/site/_data/cli/pulsar.yaml b/site/_data/cli/pulsar.yaml index f5ae17e77208f..650b18a7ea1fa 100644 --- a/site/_data/cli/pulsar.yaml +++ b/site/_data/cli/pulsar.yaml @@ -140,7 +140,7 @@ commands: env_vars: - name: PULSAR_LOG_CONF description: Log4j configuration file - default: conf/log4j.properties + default: conf/log4j2.yaml - name: PULSAR_BROKER_CONF description: Configuration file for broker default: conf/broker.conf