Skip to content

[feat] (re-invent) log4j as a logging backend #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2025

Conversation

kares
Copy link
Member

@kares kares commented Aug 8, 2025

No description provided.

@kares kares added this to the 1.3.0 milestone Aug 8, 2025
@chadlwilson
Copy link
Contributor

chadlwilson commented Aug 8, 2025

(unrelated) the JRuby 9.4 on Java 11 JVM combination is reliably flaky (sic). It's interesting, something indeterminate going on there that leads to something being the wrong type at times. Probably something implicit to JRuby rather than something this library is doing, I think. (I re-ran the action)

@chadlwilson
Copy link
Contributor

Just curious, what's your theory of the case with logging libraries these days, rather than supporting slf4j and leaving it at that?

@kares
Copy link
Member Author

kares commented Aug 8, 2025

Regarding old (logging) libraries IMHO we should have them around to ease migration for legacy users...

In terms of only supporting slf4j, that is reasonable but native log4j (2.x) is useful since it's a major logging library out there these days and also supports debug(java.lang.CharSequence) API which allows (since #306) to pass down native Ruby string objects without conversion just to satisfy the (debug(java.lang.String)) method signature.

From what jruby-rack currently support we could remove commons-logging eventually but I do not think it's a big deal.
Just like adding native support for log4j 2.x here is fairly minimal. 🤷

Does that make any sense?
I do not have numbers on log4j being the major library, hopefully I am not wrong.
Java libraries in general probably just use slf4j API but actual Java applications likely have a logging backend such as log4j.

@kares
Copy link
Member Author

kares commented Aug 8, 2025

JRuby 9.4 on Java 11 JVM combination is reliably flaky (sic). It's interesting, something indeterminate going on there that leads to something being the wrong type at times.

Yeah, seen the failure several times, it's a JRuby bug I've bumped into elsewhere as well.

@chadlwilson
Copy link
Contributor

Yup, just curious to be honest, since the saga of Java logging seems to be an endless one :-)

I thought perhaps the motivation might be specific to the needs/defaults of particular servlet containers of particular relevance to, or most commonly used with jruby-rack in your experience.

@kares kares merged commit 9606be1 into jruby:master Aug 10, 2025
37 of 38 checks passed
@kares kares deleted the log4j2-logger branch August 10, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants