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

RotatedJsonFileSink? #637

Closed
ksqrtr opened this issue Dec 29, 2024 · 3 comments · Fixed by #602
Closed

RotatedJsonFileSink? #637

ksqrtr opened this issue Dec 29, 2024 · 3 comments · Fixed by #602
Labels
enhancement New feature or request

Comments

@ksqrtr
Copy link

ksqrtr commented Dec 29, 2024

Hello! Do you have any plans to implement RotatedJsonFileSink?

@odygrd
Copy link
Owner

odygrd commented Dec 29, 2024

Hey,

At the moment, I don't have plans to implement a RotatedJsonFileSink, but it's an interesting idea, and I’ll definitely give it some thought. Typically, rotation isn’t implemented for JSON sinks because these logs are often parsed and forwarded to a UI by log agents (like Fluentd, Logstash, etc.)

For now, if you need this functionality, you can create a custom sink by combining the rotation logic from RotatingFileSink with the JSON formatting logic from JsonFileSink

@ksqrtr
Copy link
Author

ksqrtr commented Dec 30, 2024

To reduce disks pressure we write JSON-formatted logs to in-memory tmpfs with limited size and then forward them by fluentd into permanent UI storage. Being able to automatically rotate logs by size criteria would be a big plus in our case.

@ksqrtr ksqrtr closed this as completed Dec 30, 2024
@odygrd odygrd reopened this Dec 30, 2024
@odygrd odygrd added the enhancement New feature or request label Dec 30, 2024
@odygrd
Copy link
Owner

odygrd commented Dec 30, 2024

I have added this for v8 release which will be released in about a month.

a40d996

After it is released you can use this example, which is currently in v8 branch :

https://github.com/odygrd/quill/blob/v8/examples/rotating_json_file_logging_custom_json.cpp

@odygrd odygrd linked a pull request Dec 30, 2024 that will close this issue
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants