ramanathan1504 commented on code in PR #4199:
URL: https://github.com/apache/logging-log4j2/pull/4199#discussion_r3861378780
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java:
##########
@@ -621,8 +631,14 @@ private Configuration getConfiguration(
"Found configuration file `{}` for the
inactive `{}`. This `ConfigurationFactory` implementation might be inactive due
to a missing dependency.",
Review Comment:
With `log4j-1.2-api` on the classpath and `log4j1.compatibility` off, this
fires for a plain `log4j.xml`, where nothing is missing — the message names a
cause it cannot know.
````suggestion
"Found configuration file `{}` for the
inactive `{}`. This `ConfigurationFactory` implementation might be inactive due
to a missing dependency or a disabled feature.",
````
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java:
##########
@@ -524,6 +528,9 @@ public Configuration getConfiguration(
if (types != null) {
for (final String type : types) {
if (type.equals(ALL_TYPES) ||
configLocationStr.endsWith(type)) {
+ if (!factory.isActive()) {
Review Comment:
Any reason this one sits inside the `for (type : types)` loop while the
check at `:493` guards the factory loop? Here (and at `:594`, `:662`)
`continue` skips a suffix rather than the factory, so `isActive()` runs once
per supported suffix — for the 1.x factories that is a `PropertiesUtil` lookup
each time.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]