-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add org.apache.logging.log4j.core.appender.FileManager.getPath() #3855
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
base: 2.x
Are you sure you want to change the base?
Conversation
@garydgregory, would you mind sharing the use case, please? What problem is this change set addressing? |
The use case is that we (proprietary code base) have custom code that interacts with configurations, file Appender and Managers, we are moving from IO to NIO, and Strings shouldn't be used as an abstraction for where to find a file. Java has a nice abstraction for that: Path. You can also see that internally the file manager also needs a Path. HTH |
I'm a strong advocate for using Given that this is clearly important for your employer, would it be possible to ask them to let you work on #2117 during work hours? 🙏 I recall you volunteered for that on Slack, though it's totally understandable that tackling something of that scope in your spare time isn’t feasible, especially with all the Commons tasks already on your plate. There are clear benefits to transitioning Log4j’s file handling from IO to NIO:
|
Hi all, TLDR: Let's bring this PR in and then... Let's not confuse file Appenders and file Managers ;-) I took a glance at the rolling file manager and it's a much larger code base. This PR is small and focused, which is a good thing. I am willing to volunteer to migrate the other manager code ((rolling) from IO to NIO in a separate PR over the weekend probably, or at the very least initially from presenting I want to think about the migration from IO to NIO in two steps:
WDYT? For 3.0, all bets are off and breaking BC is OK IMO in this area. |
Hi @garydgregory,
I believe it's actually too narrowly scoped, to the point where it loses sight of the broader context. To be candid: would anyone upgrade Log4j just because the changelog says that Tackling the rolling file appender is definitely hard (otherwise I wouldn’t have asked you in the first place!). I’ve actually got a local branch where I started migrating the What would you say about: Step 1: Fix
This change would provide real value worth highlighting in release notes. Would you be open to expand your PR to cover this step? Step 2: Migrate rolling file appenders to NIO
|
Add
org.apache.logging.log4j.core.appender.FileManager.getPath()
Important
Base your changes on
2.x
branch if you are targeting Log4j 2; usemain
otherwise.Checklist
Before we can review and merge your changes, please go through the checklist below. If you're still working on some items, feel free to submit your pull request as a draft—our CI will help guide you through the remaining steps.
✅ Required checks
License: I confirm that my changes are submitted under the Apache License, Version 2.0.
Commit signatures: All commits are signed and verifiable. (See GitHub Docs on Commit Signature Verification).
Code formatting: The code is formatted according to the project’s style guide.
How to check and fix formatting
./mvnw spotless:check
./mvnw spotless:apply
See the build instructions for details.
Build & Test: I verified that the project builds and all unit tests pass.
How to build the project
Run:
./mvnw verify
See the build instructions for details.
Note that there are still problems on Windows:
🧪 Tests (select one)
📝 Changelog (select one)
src/changelog/.2.x.x
. (See Changelog Entry File Guide).