From slf4j-dev at qos.ch Sun Sep 3 18:39:00 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Sun, 3 Sep 2023 18:39:00 +0200 (CEST) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-450: Allow binding to be explicitly specified In-Reply-To: References: Message-ID: SLF4J / SLF4J-450 [Resolved] Allow binding to be explicitly specified ============================== Here's what changed in this issue in the last few minutes. There are 2 updates, 1 comment. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-450 ============================== 2 updates ------------------------------ Changes by Ceki Gülcü on 03/Sep/23 18:33 Resolution: Fixed Status: Resolved (was: In Progress) ============================== 1 comment ------------------------------ Ceki Gülcü on 03/Sep/23 18:28 [~toda_k] Thank you for the PR which I applied almost as is. BTW, the name of the system property is {{slf4j.provider}}. I rewrote this issue's description above to avoid confusion. ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af) From slf4j-dev at qos.ch Sun Sep 3 18:49:35 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Sun, 3 Sep 2023 18:49:35 +0200 Subject: [slf4j-dev] Release of SLF4J version 2.0.9 Message-ID: Hello All, I am very pleased to announce the release of SLF4J version 2.0.9. It is now possible to specify the provider class explicitly via the "slf4j.provider" system property, yielding full control of provider loading to the end-user. Moreover, the "slf4j.provider" system property bypasses the service loader mechanism for finding providers and may shorten SLF4J initialization. A "Bill of Materials" (BOM) file was added to the SLF4J project. This was a frequently requested feature. Garret Wilson's "Improving the Maven Bill of Materials (BOM) Pattern" document was instrumental in making this happen. Please refer to the the news page for more details on this release: http://www.slf4j.org/news.html The 2.0.x series introduces a backward-compatible fluent logging API. By backward-compatible, we mean that existing logging frameworks do not have to be changed in order for the user to benefit from the fluent logging API. However, existing frameworks *must* migrate to the ServiceLoader mechanism. The resulting internal changes are detailed in the FAQ page. http://www.slf4j.org/faq.html#changesInVersion200 The 2.0.x series builds upon the the 1.8.x series which was modularized per Java Platform Module System (JPMS/Jigsaw). The 2.0.x series requires Java 8. Binary compatibility: Mixing mixing different versions of slf4j-api.jar and SLF4J provider can cause problems. For example, if you are using slf4j-api-2.0.0.jar, then you should also use slf4j-simple-2.0.0.jar, using slf4j-simple-1.5.5.jar will not work. With the exception of the fluent API (new in SLF4J 2.0.x), from the client's perspective, all versions of slf4j-api, more specifically classes in the org.slf4j package, are backward compatible. Client code compiled with slf4j-api-N.jar will run perfectly fine with slf4j-api-M.jar for any N and M. You only need to ensure that the version of your provider matches that of the slf4j-api.jar. You do not have to worry about the version of slf4j-api.jar used to compile a given dependency in your project. You can always use *any* version of slf4j-api.jar, and as long as the version of slf4j-api.jar and its provider match, you should be fine. Donations and sponsorship You can also support SLF4J/logback/reload4j projects via donations and sponsorship. We thank our current supporters and sponsors for their continued contributions. Sponsorship link: https://github.com/sponsors/qos-ch Announcement mailing list: You can receive SLF4J/logback/reload4j related announcements by subscribing QOS.ch announce list, please visit the following URL. http://www.qos.ch/mailman/listinfo/announce Enjoy, -- Ceki Gülcü From slf4j-dev at qos.ch Mon Sep 11 21:48:00 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Mon, 11 Sep 2023 21:48:00 +0200 (CEST) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-437: Create a BOM POM In-Reply-To: References: Message-ID: SLF4J / SLF4J-437 [Resolved] Create a BOM POM ============================== Here's what changed in this issue in the last few minutes. There is 1 comment. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-437 ============================== 1 comment ------------------------------ Garret Wilson on 11/Sep/23 21:37 Hi, Ceki. I see in Maven Central we have an SLF4J BOM released! 🎉 I'll start using it right away. {quote}The mvn deploy command results in the following error. … I'll try your suggestion of moving the parent pom to a different module.{quote} Was the issue the same one I ran into—of having {{pom.xml}} and {{parent-pom.xml}} at the same directory level? Did moving {{parent-pom.xml}} to {{parent/pom.xml}} and updating the references fix the problem? ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af) From slf4j-dev at qos.ch Tue Sep 12 10:43:00 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Tue, 12 Sep 2023 10:43:00 +0200 (CEST) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-437: Create a BOM POM In-Reply-To: References: Message-ID: SLF4J / SLF4J-437 [Resolved] Create a BOM POM ============================== Here's what changed in this issue in the last few minutes. There is 1 comment. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-437 ============================== 1 comment ------------------------------ Ceki Gülcü on 12/Sep/23 10:32 [~garretwilson] Hi Garret, You wrote: {cite} Was the issue the same one I ran into—of having pom.xml and parent-pom.xml at the same directory level? Did moving parent-pom.xml to parent/pom.xml and updating the references fix the problem? {cite} I am not sure. After moving parent-pom.xml, I had to add missing elements, such as project URL, to the BOM file from the parent/pom.xml. And since the parent/pom.xml structure was just as pleasing if not more, I left it as parent/pom.xml. Why do I prefer parent/pom.xml over parent-xml.pom? I have several small scripts which search for pom.xml files that would need to be modified to search for parent-pom.xml as well. Hence my preference for parent/pom.xml. ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af) From slf4j-dev at qos.ch Tue Sep 12 18:22:00 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Tue, 12 Sep 2023 18:22:00 +0200 (CEST) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-437: Create a BOM POM In-Reply-To: References: Message-ID: SLF4J / SLF4J-437 [Resolved] Create a BOM POM ============================== Here's what changed in this issue in the last few minutes. There is 1 comment. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-437 ============================== 1 comment ------------------------------ Garret Wilson on 12/Sep/23 18:11 {quote}I am not sure. … [S]ince the parent/pom.xml structure was just as pleasing if not more, I left it as parent/pom.xml.{quote} I see. In hindsight I think having two POMs in the same folder might cause problems with various tools anyway, as there might be conflicting {{target/}} directories generated. In fact something like that is probably what was confusing the Nexus Staging Maven Plugin. I'm going to use the {{parent/pom.xml}} structure as well. Thanks for the update. I'll update the blog post with these notes. And I appreciate the mention of my article in the new BOM! ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af) From slf4j-dev at qos.ch Tue Sep 19 20:04:00 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Tue, 19 Sep 2023 20:04:00 +0200 (CEST) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-600: .addKeyValue() log-requests are not getting logged In-Reply-To: References: Message-ID: SLF4J / SLF4J-600 [Open] .addKeyValue() log-requests are not getting logged ============================== Here's what changed in this issue in the last few minutes. This issue has been created This issue is now assigned to you. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-600 ============================== Issue created ------------------------------ Ferhat Bayrak created this issue on 19/Sep/23 19:53 Summary: .addKeyValue() log-requests are not getting logged Issue Type: Bug Affects Versions: 2.0.9 Assignee: SLF4J developers list Created: 19/Sep/23 19:53 Environment: h1. my setup h2. library dependencies {code:java} org.slf4j slf4j-api 2.0.9 org.apache.logging.log4j log4j-slf4j2-impl 2.20.0 {code} h2. my log4j2 configuration {code:java} ${path}performance.log ${path}performance.%d{yyyy-MM-dd}.log INFO INFO {code} h2. my log-requests with log4j-2.20.0 {code:java} StringMapMessage log4jMap = new StringMapMessage() .with("message", "direct log4j implementation - Measure times:") .with("myDocId", documentId) .with("myInitExtractorInMs", createFormExtractor) .with("myvalidatedDocumentInMs", validatedDocument) .with("myreadPageInMs", readPage) .with("mytransformInfosInMs", transformInfos); LogManager.getLogger("PERFORMANCE").info(log4jMap); {code} with slf4j 2.0.9 {code:java} private static final Logger LOG = LoggerFactory.getLogger("PERFORMANCE"); ... LOG.atInfo().setMessage("slf4j2-with-log4j - Measure times:") .addKeyValue("myDocId", documentId) .addKeyValue("myInitExtractorInMs", createFormExtractor) .addKeyValue("myvalidatedDocumentInMs", validatedDocument) .addKeyValue("myreadPageInMs", readPage) .addKeyValue("mytransformInfosInMs", transformInfos) .log(); {code} Priority: Critical Reporter: Ferhat Bayrak Description: h1. What is the issue? slf4j2 in combination with log4j2: when logging into Files with a structurized key-value-log-requests with .addKeyValue()  (see above at # my log-request) the resulting logging-output is missing the key-value-logs (see below at # logfile output as example) it does not contain any of the key-value-pairs.   h1. log output with log4j and with slf4j in comparison h2. json output here all is fine log4j output {code:java} {     "@timestamp": "2023-09-19T17:25:51.241",     "log.level": "INFO",     "message": "direct log4j implementation - Measure times:",     "myDocId": "60",     "myInitExtractorInMs": 79,     "myreadPageInMs": 29,     "mytransformInfosInMs": 29,     "myvalidatedDocumentInMs": 164,     "event.dataset": "performance.log", }{code} slf4j output {code:java} {     "@timestamp": "2023-09-19T17:25:51.248",     "log.level": "INFO",     "message": "slf4j2-with-log4j - Measure times:",     "event.dataset": "performance.log",     "myDocId": "60",     "myInitExtractorInMs": "79",     "myreadPageInMs": "29",     "mytransformInfosInMs": "29",     "myvalidatedDocumentInMs": "164", }{code} h2. logfile-output log4j output - it is giving just one single log output in a correct way (though the ordering is a bit messy) {code:java} [19.09.2023 19:25:51,241] [INFO ] - message="direct log4j implementation - Measure times:" myDocId="60" myInitExtractorInMs="79" myreadPageInMs="29" mytransformInfosInMs="29" myvalidatedDocumentInMs="164"{code} slf4j output - this is where the bug is - all the key values are missing {code:java} [19.09.2023 19:25:51,248] [INFO ] - slf4j2-with-log4j - Measure times:{code} ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af) From slf4j-dev at qos.ch Wed Sep 20 23:29:00 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Wed, 20 Sep 2023 21:29:00 +0000 (UTC) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-600: .addKeyValue() log-requests are not getting logged In-Reply-To: References: Message-ID: SLF4J / SLF4J-600 [Resolved] .addKeyValue() log-requests are not getting logged ============================== Here's what changed in this issue in the last few minutes. There are 2 updates, 1 comment. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-600 ============================== 2 updates ------------------------------ Changes by Ceki Gülcü on 20/Sep/23 21:18 Resolution: Not a bug Status: Resolved (was: Open) ============================== 1 comment ------------------------------ Ceki Gülcü on 20/Sep/23 21:18 [~Fernie] I presume that the issue stems from the fact that log4j2 does not support key value pairs. ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af) From slf4j-dev at qos.ch Fri Sep 22 16:06:00 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Fri, 22 Sep 2023 14:06:00 +0000 (UTC) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-600: .addKeyValue() log-requests are not getting logged In-Reply-To: References: Message-ID: SLF4J / SLF4J-600 [Resolved] .addKeyValue() log-requests are not getting logged ============================== Here's what changed in this issue in the last few minutes. There is 1 comment. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-600 ============================== 1 comment ------------------------------ Ralph Goers on 22/Sep/23 13:54 Actually Ceki that is an incorrect statement as Log4j2 definitely supports logging Maps and injecting key/value pairs. But without seeing what the logging statement looks like it is impossible to know what the problem is. In any case, this should be opened as a log4j2 GitHub issue so we can provide a solution. ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af) From slf4j-dev at qos.ch Fri Sep 22 22:16:02 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Fri, 22 Sep 2023 20:16:02 +0000 (UTC) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-600: .addKeyValue() log-requests are not getting logged In-Reply-To: References: Message-ID: SLF4J / SLF4J-600 [Resolved] .addKeyValue() log-requests are not getting logged ============================== Here's what changed in this issue in the last few minutes. There is 1 comment. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-600 ============================== 1 comment ------------------------------ Ceki Gülcü on 22/Sep/23 20:04 [~Fernie] provided the relevant code under the "environment" field which is not particularly visible. I moved the relevant code under description, in particular the calls to {{logger.atInfo().addKeyValue("", "")}} which I presume log4j 2.x does not support yet. ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af) From slf4j-dev at qos.ch Sat Sep 23 01:33:00 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Fri, 22 Sep 2023 23:33:00 +0000 (UTC) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-600: .addKeyValue() log-requests are not getting logged In-Reply-To: References: Message-ID: SLF4J / SLF4J-600 [Resolved] .addKeyValue() log-requests are not getting logged ============================== Here's what changed in this issue in the last few minutes. There is 1 comment. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-600 ============================== 1 comment ------------------------------ Ralph Goers on 22/Sep/23 23:22 Thanks Ceki. It probably doesn't but it should be straightforward to get that to work. We just have to use a MapMessage instead of a ParameterizedMessage if that method gets called. I'll take a look. ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af) From slf4j-dev at qos.ch Sat Sep 23 08:44:00 2023 From: slf4j-dev at qos.ch (slf4j developers list) Date: Sat, 23 Sep 2023 06:44:00 +0000 (UTC) Subject: [slf4j-dev] [JIRA] Updates for SLF4J-600: .addKeyValue() log-requests are not getting logged In-Reply-To: References: Message-ID: SLF4J / SLF4J-600 [Resolved] .addKeyValue() log-requests are not getting logged ============================== Here's what changed in this issue in the last few minutes. There is 1 comment. View or comment on issue using this link https://jira.qos.ch/browse/SLF4J-600 ============================== 1 comment ------------------------------ Ralph Goers on 23/Sep/23 6:33 I just took a look at the code and it is adding the key/value pairs to the ThreadContextMap instead of building a MapMessage. The SLF4J documentation says {code:java} The key-value pair variant of the API stores the key-value pairs as separates objects. The default implementation currently in the org.slf4j.Logger class prefixes key-value pairs to the message. Logging backends are free and are even encouraged to offer a more customizable behaviour. {code} Given that the API says that what happens with key/value pairs is implementation specific I'd hesitate to classify this as an error. Adding %X to your pattern should cause them to be included. I can't speak to what EcsLayout does as that is not provided by Log4j but JsonTemplateLayout would allow the items to be included in the JSON. Despite this I will open a discussion on the Log4j dev list to determine if what we are doing is really the correct behavior. ============================== This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af)