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

Add support maxdays to DailyLogListener #141

Closed
ar opened this issue Oct 6, 2017 · 7 comments
Closed

Add support maxdays to DailyLogListener #141

ar opened this issue Oct 6, 2017 · 7 comments
Labels

Comments

@ar
Copy link
Member

ar commented Oct 6, 2017

Similar to RotateLogListener, it would be nice to have the ability to automatically erase old log files.

@ar ar added the feature label Oct 6, 2017
@alcarraz
Copy link
Contributor

alcarraz commented Oct 7, 2017

Would it be ok to have a max-age property, and deleting files with old timestamps?
Difference with RotateLogListener is that e don't have the age (and is not really simple to derive from the name due to the format ability).

Anyway we could do simple patches to DailyLogListener but maybe it would need to be deprecated in favor of something like (Cron|Quartz)RoteateLogListener based on quartz or something similar like cron4j.

@ar
Copy link
Member Author

ar commented Oct 7, 2017

We have a quartz module in jPOS-EE, works great, but I'd like to keep it there and not add it to jPOS. Perhaps it's easier to deal with a copies and just keep the most recent n copies, like we do with RotateLogListener. For max-age I think we need to rely on the operating system to give us the creation date, if we can get that accurately across OSs, then I'm fine too. We'll have to experiment a bit.

@alcarraz
Copy link
Contributor

alcarraz commented Oct 8, 2017 via email

@ar
Copy link
Member Author

ar commented Oct 8, 2017

Sure. Appreciate that. Wonder if we want to go with modification date. On a second thought, I talked about creation date, but modification date is good too, if for some reason an operator has edited the file, it might just mean she wants to keep it for a little longer, so no harm keeping it.

@alcarraz
Copy link
Contributor

alcarraz commented Oct 9, 2017

I tend to overthink, but would it be worthy to add an option to select the modification or creation date usage?

I don't know if all OSs have record of the two dates. At least it seems linux does not and the Basic File class only provides lastModificationTime, we could use java.nio.file.attribute and use the creationTime but at least in some basic testing I did in my machine it returns the same for the two attributes.

So I don't know if it worthy the extra code to obtain that attributes from the java.nio.file package.

@ar
Copy link
Member Author

ar commented Oct 9, 2017

I don't think it's required, lastModificationTime is good enough.

@ar
Copy link
Member Author

ar commented Aug 10, 2018

This has been implemented in PR181 (#181). Property is actually called maxage.

@ar ar closed this as completed Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants