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

Logs is lost due to program closing before the periodic batch period #116

Open
linxiaoxin opened this issue Sep 19, 2023 · 1 comment
Open

Comments

@linxiaoxin
Copy link

I am running a console program and the logs are end to cloudwatch. The console program ends when exception is encountered and exit. I added sleep command to cause the program to sleep for 1 secs so that logs can be send to cloudwatch. Is there a way to handle this gracefully without having to put a wait in every batch program so that logs are not lost.

@wparad
Copy link
Collaborator

wparad commented Sep 19, 2023

I think it would be a great idea to catch the signal termination event, block, attempt to send the logs before shutting down. Logs are important. Someone would need to look into serilog core to see if it supports something like that natively already, because arguably that is where the problem would be. We just take the instructions from the core library on how to send logs, the functionality doesn't really belong in here.

However, it is possible that we are missing some configuration to make sure that happens.

So with that, can I recommend opening a ticket with Serilog Core https://github.com/serilog/serilog, asking for support of this feature. It seems like a great idea.

I'll leave this ticket open while we wait to hear back with what they say.

@wparad wparad closed this as completed Sep 19, 2023
@wparad wparad reopened this Sep 19, 2023
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