Closed ghstahl closed 6 months ago
Sorry I don't understand your request
I am using zerolog today to write to stdout and that gets sent to datadog.
There are certain logs events that I would like to be sent elsewhere. Not all, just ones with the type I am interested in.
So I either write a custom output based on ConsoleWriter, call it MyCustomWriter, that filters for just the ones I want and write it somewhere else (like kafka).
I was wondering if there is another way that zerolog has for me to get the full log its about to lay down.
The most efficient would be to have a separate logger for those events. Note that ConsoleWriter is not meant to be used in production, you will lose of the performance benefits of this library. You could write a custom writer and parse the buffer for the type without deserializing the JSON, but it will still be quite inefficient compared to a separate logger.
I want to hook any log that has a field
type=audit
.