qos-ch / reload4j

reload4j is a drop-in replacement for log4j 1.2.17
Apache License 2.0
148 stars 22 forks source link

Reload4j is not allowing to customize log severity of PatternLayout #60

Closed Dharani0618 closed 1 year ago

Dharani0618 commented 1 year ago

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:

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

Current event severity printed in Logs after doing above modifications, log severity is printing exactly what we have given, instead of expected results. "severity":"WARN{WARN=warning, DEBUG=debug, ERROR=error, FATAL=critical, TRACE=debug, INFO=info}"

Expected Event Severity Printed in Logs : info/ warning / debug / error / trace (in lower case) will it be possible to get the custom pattern from reload4j?

ceki commented 1 year ago

Reload4j is a fork of log4j 1.x not log4j 2.x. The functionality you mention is available in log4j 2.x not log4j 1.x. Thus, reload4j will not be incorporating said functionality.