You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Thomas Vandahl <tv...@apache.org> on 2026/01/08 16:07:09 UTC
RfD: Turbine Logging with java.lang.System.Logger
Hi folks,
when updating the Turbine dependencies, I found that the list of Log4j libraries that we use is quite comprehensive. Several other dependency libraries use slf4j as well. I was a bit hesitant to open this subject again because everyone seems to have strong opinions about logging. But anyway, here it goes:
Since Java 9, the JDK has a much improved logger implementation in java.lang.System.Logger. I switched to this in commons-jcs3 and it turned out to be quite powerful. The standard implementations relies on JUL bust it supports a simple Service Loader mechanism to redirect logging to an implementation of your choice (for log4j2, one would simply add the log4j-jpl dependency).
See the blog article https://renato.athaydes.com/posts/java-system-logging for more information.
See my slim wrapper around the logger to keep the familiar methods in org.apache.commons.jcs3.log.SystemLogAdapter
I have no strong feelings about this but wanted to start the discussion anyway.
What do you think?
Bye, Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
For additional commands, e-mail: dev-help@turbine.apache.org
Re: RfD: Turbine Logging with java.lang.System.Logger
Posted by Jeffery Painter <je...@jivecast.com>.
Hi Thomas,
I also have no strong opinions, and I support any simplification in
logging use/configuration.
-
Jeff
On 1/8/26 11:07, Thomas Vandahl wrote:
> Hi folks,
>
> when updating the Turbine dependencies, I found that the list of Log4j libraries that we use is quite comprehensive. Several other dependency libraries use slf4j as well. I was a bit hesitant to open this subject again because everyone seems to have strong opinions about logging. But anyway, here it goes:
>
> Since Java 9, the JDK has a much improved logger implementation in java.lang.System.Logger. I switched to this in commons-jcs3 and it turned out to be quite powerful. The standard implementations relies on JUL bust it supports a simple Service Loader mechanism to redirect logging to an implementation of your choice (for log4j2, one would simply add the log4j-jpl dependency).
>
> See the blog article https://renato.athaydes.com/posts/java-system-logging for more information.
> See my slim wrapper around the logger to keep the familiar methods in org.apache.commons.jcs3.log.SystemLogAdapter
>
> I have no strong feelings about this but wanted to start the discussion anyway.
>
> What do you think?
>
> Bye, Thomas
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
> For additional commands, e-mail: dev-help@turbine.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
For additional commands, e-mail: dev-help@turbine.apache.org
Re: RfD: Turbine Logging with java.lang.System.Logger
Posted by Thomas Vandahl <tv...@apache.org>.
Replying to myself.
> Am 08.01.2026 um 17:07 schrieb Thomas Vandahl <tv...@apache.org>:
>
> Hi folks,
>
> when updating the Turbine dependencies, I found that the list of Log4j libraries that we use is quite comprehensive. Several other dependency libraries use slf4j as well. I was a bit hesitant to open this subject again because everyone seems to have strong opinions about logging. But anyway, here it goes:
I see that log4j-1.2-api and log4j-jcl are listed as Turbine dependencies but found no use reference of them. mvn clean test runs fine without them. Why are they in the list, anyway?
Bye, Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
For additional commands, e-mail: dev-help@turbine.apache.org
Re: Turbine Logging with java.lang.System.Logger
Posted by Thomas Vandahl <tv...@apache.org>.
Hi Georg,
> Am 09.01.2026 um 14:29 schrieb Kallidis, Georg <ge...@fu-berlin.de>:
>
> Hi Thomas, hi Jeffery,
>
> I've read the blog article and we may change it.
>
> Formatting is as the author points out, will be log4j formatting, which is different from JUL, which is default for System.Logger as you said.
>
> In commons-jcs3 default JUL message formatting is used with a custom Logger - This would only be possible, as it is said in the blog, if using lo4j-jul instead of log4j-jpl.
>
> That is we may use java.lang.System.Logger, but Messagetext formatting could not be used.
>
> Nevertheless, log4j may be then at the right place as underlying implementation conforming more to this standard (and replaced more easily, if required)..
>
I'll come up with a proposal in a separate branch. We can review it together in a PR-Review on Github, if you like.
Bye, Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
For additional commands, e-mail: dev-help@turbine.apache.org
AW: Turbine Logging with java.lang.System.Logger
Posted by "Kallidis, Georg" <ge...@fu-berlin.de>.
Hi Thomas, hi Jeffery,
I've read the blog article and we may change it.
Formatting is as the author points out, will be log4j formatting, which is different from JUL, which is default for System.Logger as you said.
In commons-jcs3 default JUL message formatting is used with a custom Logger - This would only be possible, as it is said in the blog, if using lo4j-jul instead of log4j-jpl.
That is we may use java.lang.System.Logger, but Messagetext formatting could not be used.
Nevertheless, log4j may be then at the right place as underlying implementation conforming more to this standard (and replaced more easily, if required)..
Concerning log4j-jcl, commons logging may come in as transient dependency?
Best regards,
Georg
-----Ursprüngliche Nachricht-----
Von: Thomas Vandahl <tv...@apache.org>
Gesendet: Donnerstag, 8. Januar 2026 17:07
An: Turbine Developers List <de...@turbine.apache.org>
Betreff: RfD: Turbine Logging with java.lang.System.Logger
Hi folks,
when updating the Turbine dependencies, I found that the list of Log4j libraries that we use is quite comprehensive. Several other dependency libraries use slf4j as well. I was a bit hesitant to open this subject again because everyone seems to have strong opinions about logging. But anyway, here it goes:
Since Java 9, the JDK has a much improved logger implementation in java.lang.System.Logger. I switched to this in commons-jcs3 and it turned out to be quite powerful. The standard implementations relies on JUL bust it supports a simple Service Loader mechanism to redirect logging to an implementation of your choice (for log4j2, one would simply add the log4j-jpl dependency).
See the blog article https://renato.athaydes.com/posts/java-system-logging for more information.
See my slim wrapper around the logger to keep the familiar methods in org.apache.commons.jcs3.log.SystemLogAdapter
I have no strong feelings about this but wanted to start the discussion anyway.
What do you think?
Bye, Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
For additional commands, e-mail: dev-help@turbine.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@turbine.apache.org
For additional commands, e-mail: dev-help@turbine.apache.org