Skip to content
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

Option to exclude "current-date" from FileWriter.daily #57

Closed
andreak opened this issue Apr 30, 2018 · 12 comments
Closed

Option to exclude "current-date" from FileWriter.daily #57

andreak opened this issue Apr 30, 2018 · 12 comments
Assignees

Comments

@andreak
Copy link

andreak commented Apr 30, 2018

Using FileWriter.daily, the current ("today") logfile's date is part of the filename.
It would be nice to make an option for excluding the date from the current-file. This would make it easier to make existing monitoring-jobs (which today monitors log4j/slf4j files) to continue monitoring the logfiles, without needing to change them.

@darkfrog26
Copy link
Contributor

You mean having the current daily log have a consistent filename and at the conclusion of the day it gets renamed to the date stamp?

@andreak
Copy link
Author

andreak commented May 1, 2018

Yes, this makes it consistent with how log4j's DailyRollingFileAppender behaves.

@darkfrog26 darkfrog26 self-assigned this May 1, 2018
@darkfrog26
Copy link
Contributor

I need to spend a little more time with the path functionality anyway. This is a good idea. I'll get it added to the current release.

Thanks @andreak

@andreak
Copy link
Author

andreak commented May 1, 2018

Great!

darkfrog26 added a commit that referenced this issue May 1, 2018
@darkfrog26
Copy link
Contributor

@andreak take a look at the re-working of FileWriter. I need to write some tests to make sure everything is happy with the rolling logging, but it offers a much more flexible path and hopefully fulfills all of your needs.

@andreak
Copy link
Author

andreak commented May 1, 2018

Ok, so instead of using .daily() I must use apply() supplying my own instance of FormattedFileLoggingManager, which takes a custom fileName func where I simply control whether or not to use the millis-value as part of the filename or not?
Works for me.

@darkfrog26
Copy link
Contributor

Actually, you can just use rolling if you're doing simple daily rolling files.

@andreak
Copy link
Author

andreak commented May 1, 2018

Aha, right.

@darkfrog26
Copy link
Contributor

@andreak can you close this ticket once you've confirmed it fulfills your needs?

@andreak
Copy link
Author

andreak commented May 1, 2018

It looks like it'll fulfill my needs, but I have to test with actual rollover, which happens in about 35 min. :-)
I'll close it if all goes well.

@andreak
Copy link
Author

andreak commented May 1, 2018

Works, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants