Closed bhavishyachandra closed 3 years ago
@bhavishyachandra you most likely need to call Log.CloseAndFlush()
before exiting.
I have a similar problem, although not with the splunk sink. And so may be completed unrelated if it is down to the sinks flush implementation.
I am calling Log.CloseAndFlush(); in a finally block in the Handle method. The faster the lambda execution the less chance i will get any logs written at all...
I have this lambda set to run every minute, it only logs during the cold start which took 1295.98 ms but every subsequent execution that takes 200 ms or less.. no logs.
I suspect CloseAndFlush is not synchronous...
Did you find a solution?
@oguzhancagliyan I don't have a solution. we moved away from Lambda and hosted our API in a docker container.
This is proving to be a big problem for us too. When sending logs directly to Splunk from a C# lambda (it's an aspnetcore app) they get dropped if the lambda executes quickly. Has anyone thought about ways to solve this in a clean way? Some sort of middleware that flushes on each request? Is there a way to just "flush" and not close?
Closing as a part of larger Serilog contrib reorg
Hello
I was using this sink to log to Splunk from my C# Serverless Lambda. We found that the platform kills all background threads after the API response is sent from the controller. This was causing some logs to go missing. Would be great if you could add an additional parameter that makes all the calls to Splunk synchronous in place of the periodic batching.
Thanks