[
https://issues.apache.org/jira/browse/ZOOKEEPER-4637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17641853#comment-17641853
]
Devarshi Shah edited comment on ZOOKEEPER-4637 at 12/1/22 11:36 AM:
--------------------------------------------------------------------
Hi [~cnauroth],
Thanks for your immediate response! Sorry for misunderstanding from the
description; actually, to fix logging related critical vulnerabilities we have
uplifted to log4j2 in Apache Zookeeper 3.7.0.
We want to print the event severity with customized severity names in the logs
instead of default Uppercase severities. We have modified log4j.properties like:
{code:java}
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ}
[myid:%X{myid}] - %p{WARN=warning, DEBUG=debug, ERROR=error, FATAL=critical,
TRACE=debug, INFO=info} [%t:%C{1}@%L] - %m%n {code}
Current event severity printed in Logs after doing above modifications, log
severity is printing exactly what we have given, instead of expected results.
{code:java}
"severity":"WARN{WARN=warning, DEBUG=debug, ERROR=error, FATAL=critical,
TRACE=debug, INFO=info}" {code}
Expected Event Severity Printed in Logs : info/ warning / debug / error / trace
(in lower case)
Can we get above type of modified pattern directly from reload4j in Apache
Zookeeper 3.7.1, instead of replacing reload4j (which comes packed in Apache
Zookeeper binary) with log4j2?
Or, if Apache Zookeeper next version will also keep using the reload4j/log4j1,
will it be possible to get the custom pattern from reload4j out-of-the-box?
was (Author: thedevarshishah):
Hi [~cnauroth],
Thanks for your immediate response! Sorry for misunderstanding from the
description; actually, to fix logging related critical vulnerabilities we have
uplifted to log4j2 in Apache Zookeeper 3.7.0.
We want to print the event severity with customized severity names in the logs
instead of default Uppercase severities. We have modified log4j.properties like:
{code:java}
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ}
[myid:%X{myid}] - %p{WARN=warning, DEBUG=debug, ERROR=error, FATAL=critical,
TRACE=debug, INFO=info} [%t:%C{1}@%L] - %m%n {code}
Current event severity printed in Logs after doing above modifications, log
severity is printing exactly what we have given, instead of expected results.
{code:java}
"severity":"WARN{WARN=warning, DEBUG=debug, ERROR=error, FATAL=critical,
TRACE=debug, INFO=info}" {code}
Expected Event Severity Printed in Logs : info/ warning / debug / error / trace
(in lower case)
Can we get above type of modified pattern directly from reload4j in Apache
Zookeeper 3.7.1, so that replacing reload4j, which comes packed in Apache
Zookeeper, with log4j2?
> Apache Zookeeper 3.7.1 is not allowing to change PatternLayout to manipulate
> the logs format
> --------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-4637
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4637
> Project: ZooKeeper
> Issue Type: Bug
> Affects Versions: 3.7.1
> Reporter: Devarshi Shah
> Priority: Major
>
> We are using the PatternLayout of log4j.properties to get the logs in custom
> format in our Apache Zookeeper cluster:
> {code:java}
> appender.console.layout.pattern = {"timestamp":
> "%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ}", "severity": "%p{lowerCase=true}",
> "message": "%m"}%n {code}
> To fix logging related critical vulnerabilities we have uplifted to log4j2 in
> Apache Zookeeper 3.7.0; though, the Apache Zookeeper 3.7.1 is using Reload4j
> 1.2.19 which is based on Log4j1 1.2.17. So for us, it's downgrade from Log4j
> 2.17.2 to 1.2.17. We've tried to modify the PatternLayout accordingly, but it
> didn't work.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)