You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Fariusz (via GitHub)" <gi...@apache.org> on 2025/03/21 10:28:06 UTC
[I] Unwanted logging "Starting configuration...", "Start watching for changes to...", etc) after update. [logging-log4j2]
Fariusz opened a new issue, #3566:
URL: https://github.com/apache/logging-log4j2/issues/3566
## Description
After update dependencies:
```
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
```
from version 2.22.1 to version 2.24.3 it started to log unwanted logging lines:
```
Starting configuration XmlConfiguration[location=… , lastModified=…]...
Start watching for changes to … every 0 seconds
Configuration XmlConfiguration[location=… , lastModified=…] started.
Stopping configuration org.apache.logging.log4j.core.config.DefaultConfiguration@…
Configuration org.apache.logging.log4j.core.config.DefaultConfiguration@… stopped.
Stopping configuration XmlConfiguration[location=… , lastModified=…]...
Configuration XmlConfiguration[location=… , lastModified=…] stopped.
```
## Configuration
**Version:** 2.24.3
**Operating system:** Redhat 8
**JDK:** OpenJDK 17
Log4j2.xml
```
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info" strict="true" name="XMLConfigForTest">
<Filter type="ThresholdFilter" level="debug"/>
<Appenders>
<Appender type="Console" name="STDOUT">
<Layout type="PatternLayout" pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n"/>
</Appender>
<Appender type="RollingFile" name="fileAppender" fileName="/.../.../.../.../logs/javaApp.log"
filePattern="/.../.../.../.../logs/javaApp%d{yyyy-MM-dd_HHmmss}.log" filePermissions="rw-rw-r--">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />
<Policies>
<SizeBasedTriggeringPolicy size="10 MB" />
</Policies>
</Appender>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="fileAppender" />
</Root>
<Logger name="org.springframework" level="WARN" additivity="false">
<Appender-ref ref="fileAppender" level="WARN" />
</Logger>
<Logger name="XYZ.ABC" level="INFO" additivity="false">
<Appender-ref ref="fileAppender" level="INFO" />
</Logger>
</Loggers>
</Configuration>
```
```
#! /bin/bash
javaApps_modules=/.../.../.../.../modules
cd $javaApps_modules/${project.artifactId}
/usr/bin/java -Xmx1500m -Dlog4j.configurationFile=./log4j2.xml -jar ${project.artifactId}.jar $@
```
## Logs
```
2025-03-21T10:17:03.408045086Z main INFO Starting configuration XmlConfiguration[location=/.../.../.../JavaApp/modules/JavaApp/log4j2.xml, lastModified=2025-03-21T10:01:49.648Z]...
2025-03-21T10:17:03.408531502Z main INFO Start watching for changes to /.../.../.../JavaApp/modules/JavaApp/log4j2.xml every 0 seconds
2025-03-21T10:17:03.408943877Z main INFO Configuration XmlConfiguration[location=/.../.../.../.../modules/JavaApp/log4j2.xml, lastModified=2025-03-21T10:01:49.648Z] started.
2025-03-21T10:17:03.409866752Z main INFO Stopping configuration org.apache.logging.log4j.core.config.DefaultConfiguration@1da51a35...
2025-03-21T10:17:03.410062127Z main INFO Configuration org.apache.logging.log4j.core.config.DefaultConfiguration@1da51a35 stopped.
2025-03-21T10:17:03.829151377Z pool-1-thread-1 INFO Stopping configuration XmlConfiguration[location=/.../.../.../.../modules/JavaApp/log4j2.xml, lastModified=2025-03-21T10:01:49.648Z]...
2025-03-21T10:17:03.829701752Z pool-1-thread-1 INFO Configuration XmlConfiguration[location=/.../.../.../.../modules/JavaApp/log4j2.xml, lastModified=2025-03-21T10:01:49.648Z] stopped.
```
## Reproduction
[An isolated test reproducing the test.
JUnit tests similar to the ones in the code base are extremely appreciated.]
Everytime jar is used.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Unwanted logging "Starting configuration...", "Start watching for changes to...", etc) after update. [logging-log4j2]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz closed issue #3566: Unwanted logging "Starting configuration...", "Start watching for changes to...", etc) after update.
URL: https://github.com/apache/logging-log4j2/issues/3566
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Unwanted logging "Starting configuration...", "Start watching for changes to...", etc) after update. [logging-log4j2]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #3566:
URL: https://github.com/apache/logging-log4j2/issues/3566#issuecomment-2743977370
@Fariusz,
> ```xml
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="info" strict="true" name="XMLConfigForTest">
> ...
> </Configuration>
> ```
You receive those messages, because you configure [`status` configuration attribute](https://logging.apache.org/log4j/2.x/manual/configuration.html#configuration-attribute-status) to `INFO`. At the `INFO` level you should see the most important events that are not considered to be problems.
> ```
> 2025-03-21T10:17:03.408531502Z main INFO Start watching for changes to /.../.../.../JavaApp/modules/JavaApp/log4j2.xml every 0 seconds
> ```
This might be certainly improved. :wink: The configuration file is not actually being monitored continuously.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Unwanted logging "Starting configuration...", "Start watching for changes to...", etc) after update. [logging-log4j2]
Posted by "Fariusz (via GitHub)" <gi...@apache.org>.
Fariusz commented on issue #3566:
URL: https://github.com/apache/logging-log4j2/issues/3566#issuecomment-2742950154
I've found the same problem for other user but it wasn't helpful for me.
https://github.com/apache/logging-log4j2/issues/3100
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org