Closed
Description
I'm using log4j2 for logging and tried to simplify the logging pattern by setting logging.pattern.dateformat
to HH:mm:ss.SSS
.
build.gradle
:
tasks.withType(Test) {
systemProperty('logging.pattern.dateformat', 'HH:mm:ss.SSS')
}
However, the date format remains unchanged - yyyy-MM-dd HH:mm:ss.SSS
.
I tried to debug the application and found out that log4j2.xml
file has these lines:
At the same time, Logback configuration is a bit different:
When I put my custom log4j.xml
file on the classpath, it started working fine:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Properties>
<Property name="LOG_EXCEPTION_CONVERSION_WORD">%xwEx</Property>
<Property name="LOG_LEVEL_PATTERN">%5p</Property>
<Property name="CONSOLE_LOG_PATTERN">%clr{%d{${env:LOG_DATEFORMAT_PATTERN:-${sys:LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}}}{faint} %clr{${LOG_LEVEL_PATTERN}} %clr{%pid}{magenta} %clr{---}{faint} %clr{[%15.15t]}{faint} %clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
</Properties>
<!-- ... ->
</Configuration>
Shouldn't CONSOLE_LOG_PATTERN
property be defined in a way like this?
I suppose, the same is about LOG_EXCEPTION_CONVERSION_WORD
and LOG_LEVEL_PATTERN
properties. WDYT?
Metadata
Metadata
Assignees
Labels
A general bugA general bug