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

The feature to automatically split log files based on policy? #134

Open
myConsciousness opened this issue Apr 11, 2022 · 5 comments
Open

Comments

@myConsciousness
Copy link
Contributor

Hi amazing developers,

This package is great, but the file output specifications seem a bit weak. What is needed, especially when it comes to file output, is the ability to create a separate file and move the write destination when a certain number of lines or size is reached.

This split policy is then supposed to be passed by the user in the form of a Configuration object.

It is not possible with the current specification to pass the file object directly to the constructor, but I think it is feasible enough to add a constructor with a name like fromConfig.

Or does this idea not fit the design philosophy of this package?

Thank you.

@haarts
Copy link
Collaborator

haarts commented Jun 3, 2022

You are talking about log rotation?

Personally I would let a separate piece of software do that for me like logrotate. But I guess you could write a custom LogOutput class too. I'm won't change any existing classes for this. But I'm more than happy to accept a new LogOutput class!

@myConsciousness
Copy link
Contributor Author

Yes it's about log rotation! I'm not a native English speaker, so this is the first time I know the name in English for this mechanism haha, thanks :)

It's true that this would be better to create a new class that extends LogOutput rather than adding it to an existing class. I will first create a prototype and test it when I have time 👍

@antonshkurenko
Copy link

@myConsciousness Do you have some results?

@myConsciousness
Copy link
Contributor Author

Hi @antonshkurenko ,

I was very busy and I couldn't touch it yet, but as @dgurudot suggested an interesting repository it's easy to implement.

However, I felt the implementation of the repository @dgurudot referred us is a bit difficult to use in many cases. If it's to be implemented in this repository, it should be more generic :)

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

4 participants