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

log rotation #16

Open
joeblew99 opened this issue Jan 1, 2016 · 3 comments
Open

log rotation #16

joeblew99 opened this issue Jan 1, 2016 · 3 comments

Comments

@joeblew99
Copy link

i am using this in an environment where the WAN gateway is not always up.
The servers are in remote locations.

So i was wondering if this supports some sort of log rotation, but still able to work with sinks ?

@cypriss
Copy link
Member

cypriss commented Jan 1, 2016

@joeblew99 To directly answer your question, there's no built-in log rotation with health.

However, I might not understand your question. How does an unreliable WAN and remote servers relate to log rotation? What I typically do is log to a file on the server, and use the logrotate tool to rotate that file.

@joeblew99
Copy link
Author

Well because the WAN connection upstream of the remote server sucks, I need to store the logs.
So I need to remote server to push the log files up to bugsnag only when the connection is good.

I am assuming that after it has pushed the logs up, it will remove them from the local storage. Otherwise I would need to do log rotation in such a way that it deletes the logs older than 7 days, so the hard disk does not fill up forever.

How does this fit with your heslthd ?

Am sorry for asking basic questions, but its been a long week of deadlines.

I thought the fact that your code is designed for jobs to be very good for the type of project I have.

@cypriss
Copy link
Member

cypriss commented Jan 2, 2016

@joeblew99 Gotcha. You might need to do something custom to handle that scenario. There's no logic in health that retries when the connection is good, for instance.

The healthd architecture might be something you could look into. The JsonPollingSink will store metrics (not logs) for 5 minutes and expose them on an endpoint (now that I think about it, that sink actually does 'rotate' metrics). Then, healthd can scrape those metrics. This would be helpful in the case of unreliable connections -- if healthd fails to get some metrics, it can try again as long as it happens in 5 minutes.

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

2 participants