ppkarwasz commented on issue #3088: URL: https://github.com/apache/logging-log4j2/issues/3088#issuecomment-2672567687
> I presume the issue is that `PropertiesConfigurationBuilder::build` should not throw. Can we implement is as follows? > > public PropertiesConfiguration build() { > try { > return unsafeBuild(); > } catch (Exception error) { > LOGGER.error("...", error); > return null; > } > } On of the goals is for the `PropertiesConfigurationFactory` to behave like the `XmlConfigurationFactory`. In the XML format if an appender does not have a `name` property, the appender will be ignored, but the rest of the configuration will work. If we apply the solution you propose, a missing `name` property in a `log4j2.properties` configuration file will cause the entire configuration to be ignored. Note that I am not strongly opinionated, which behavior is the correct one, as long as all the formats behave in the same way. Having a partially applied configuration is a PITA. Tomcat uses a similar philosophy for listening ports: if you mess up the configuration, some connectors (e.g. port 443) may fail to start, but the server will not fail. They have however an [`o.a.c.startup.EXIT_ON_FAILURE` configuration property] that prevents the server to start if any exception is thrown during initialization. We could introduce a similar property. -- 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-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org