As I got zero reply to that answer, let me rephrase it probably more easily:
I would like to use slog, no other logging library
I would like to have an entry called eventID which is at the root level and has a unique uuid for every log entry
I would like to use a group for every application specific key-val pairs
What I trired so far:
- Use a Handler to add eventID : The key gets added to the logger yet at the group nesting level, not at the root level
- Use a ReplaceAttr-Function: I add the key on initiailisation yet leave the value unassigned to Replace it in the ReplaceAttr-Function: The ReplaceAttr-Function sees the root level addded eventID only untill a call to .WithGroup, then the eventId is no longer available within the ReplaceAttr-Function
Any help?