Giter VIP home page Giter VIP logo

Comments (7)

lalmeras avatar lalmeras commented on August 29, 2024

Behavior change comes with log4j2 2.19.x. log4j2 2.13.x - 2.18.x is OK. So only igloo 4.4+ is affected (including 5.x). We check this hypothesis.

from igloo-parent.

lalmeras avatar lalmeras commented on August 29, 2024

Errata : Behavior change comes with log4j2 2.18.x. log4j2 2.13.x - 2.17.2 is OK. So only igloo 4.3+ is affected (including 5.x).

Overriding org.apache.logging.log4j:* dependencies with 2.17.2 version is a working fix for this issue.

from igloo-parent.

lalmeras avatar lalmeras commented on August 29, 2024

log4j2 2.17.2 cannot be used with slf4j 2.x ; rollback to log4j2 2.17.2 implies slf4j rollback (no impact as slf4j 1.7 and 2.x are API-compatible).

from igloo-parent.

lalmeras avatar lalmeras commented on August 29, 2024

For log4j2 2.18+, the problem is that org.apache.logging.log4j.util.PropertiesUtil.Environment previously has a get(propertyName) method that always lookup first system properties before using various property sources.

In igloo, we have a log4j2.component.properties with the content (automatically loaded by log4j2).

log4j2.configurationFile=log4j2.properties

So first load set log4j2.configurationFile in log4j2 configuration cache (cf Environment). Subsequent reload just loads again the same value from log4j2.component.properties and system property override is just ignored.

It explains this simple reproducer without Igloo does not exhibit the failure (if log4j2-custom.properties switch level to error, second message is not displayed with both 2.17.0 and 2.18.0):

		LogManager.getLogger().warn("start");
		System.setProperty("log4j.configurationFile", "log4j2.properties,log4j2-custom.properties");
		// reload log4j2 properties
		PropertiesUtil.getProperties().reload();
		// reload configuration
		((LoggerContext) LogManager.getContext(false)).reconfigure();
		LogManager.getLogger().warn("stop");

I need to check why this log4j2.component.properties was added.

from igloo-parent.

lalmeras avatar lalmeras commented on August 29, 2024

35abb86 fixes issue with version 5.0.2.

from igloo-parent.

lalmeras avatar lalmeras commented on August 29, 2024

Issue comes from a mixed usage of legacy log4j.configurationFile in programmatic configuration and log4j2.configurationFile in log4j2.component.properties. log4j2 2.17 and before seems to correctly override configuration even if a different property key is used. log4j2 2.18+ does not longer support this behavior.

from igloo-parent.

lalmeras avatar lalmeras commented on August 29, 2024

b819716 fixes issue with version 4.4.2

01e3f15 fixes issue with version 4.3.1

from igloo-parent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.