Closed lukos closed 2 years ago
Hey,
yes, you should be able to use boostProperties configuration:
"WriteTo": [
{
"Name": "LogzIo",
"Args": {
"authToken": "token-goes-here",
"type": "app",
"dataCenterSubDomain": "listener-uk",
"useHttps": true,
"batchPostingLimit": 5000,
"period": "00:00:02",
"lowercaseLevel": true,
"Port": 8071,
"boostProperties": true
}
}
]
Thanks. That works great for the properties although I still don't see all events unless I step through slowly enough to give them time to send (not crazy slow). The pod is checking for a batch of work and if there is none, it will log some messages an exit. Although I don't need all of the log messages in this example, I am worried that if it does pick up work but still finished quickly, I won't see all log messages.
I call Log.CloseAndFlush();
in a finally block. Is there any other way I can make sure the messages are sent before the application exits?
Thanks
Sorry. It does work fine after all. It was because I was calling Log.CloseAndFlush()
in a finally but calling Environment.Exit() which basically kills the app without finishing gracefully (this is needed to make the Docker container report the correct code to the Cluster!)
I have refactored to set a return code, call the finally and then call Environment.Exit().
We have previously used LogzIoDurableHttp for our microservices and it all works well. If we call e.g.
.Enrich.WithProperty("AppName", "Microservices.EmailWorker")
then in logzio, this appears as a top level property.However, we have some short running pods that should not use buffering because they might not run for long enough to flush the buffer. I followed the advice on the front page and changed the config to use:
But doing this means that when I call
.Enrich.WithProperty("AppName", "Microservices.EmailWorker")
, this is not added as a top-level property but as a child of "properties" which breaks filtering:Is there something else I can do to make these appear as top-level?
Thanks