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

will log4rs support file size control and rolling file ? #8

Closed
Reposkeeper-zz opened this issue Jan 13, 2016 · 10 comments
Closed

will log4rs support file size control and rolling file ? #8

Reposkeeper-zz opened this issue Jan 13, 2016 · 10 comments

Comments

@Reposkeeper-zz
Copy link

No description provided.

@sfackler
Copy link
Collaborator

Yep, appender configuration's pretty rudimentary right now, but log rotation is definitely something I want to add.

@Reposkeeper-zz
Copy link
Author

I like this lib. But log rotation is a rigid requirement for me. Maybe I should not ask , but I really want to know is this requirement in schedule already?

@sfackler
Copy link
Collaborator

It's part of some expansion I have been meaning to do. I'll hack on it over the weekend.

@Reposkeeper-zz
Copy link
Author

That's great,I am looking forward to it

@sfackler
Copy link
Collaborator

Now that log4rs 0.4 is released, I'm going to start tackling this. I think I'll probably work on it in a separate repo/crate initially until the API gets worked out, but then move it in since it's such a core concept.

@jwilm
Copy link
Contributor

jwilm commented Mar 30, 2016

While you're thinking about the API, it would be nice to support external rotation utilities like logrotate. I think that basically means exposing a method which causes appenders to reopen their log files.

@sfackler
Copy link
Collaborator

I was planning on having a similar setup to Logback, where there's a "triggering policy" that decides when the log should roll, and a "rotation policy" that decides what to do at that point. I think it should be possible to write a triggering policy that the logback postrotate command can poke, and a rotation policy that just closes and reopens the file.

@jwilm
Copy link
Contributor

jwilm commented Mar 30, 2016

That sounds great!

@sfackler
Copy link
Collaborator

I'm working on this here: https://github.com/sfackler/log4rs-rolling-file

Not quite ready for a release yet, but the basics are there.

@sfackler
Copy link
Collaborator

This is now on crates.io: https://crates.io/crates/log4rs-rolling-file

It's still missing some functionality like TimeBasedRollingPolicy which is a bit weird from an API perspective but probably the most common policy people actually use, so I'm going to keep it in a separate crate for now until that gets worked out.

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

No branches or pull requests

3 participants