zerolog icon indicating copy to clipboard operation
zerolog copied to clipboard

custom message field name with context

Open mcspring opened this issue 5 years ago • 0 comments

Background

You can custom message field name of zerolog by overwriting zerolog.MessageFieldName for global.

Problem

In some case, we want to log message with special name for info, such as log time duration with cost name.

Solution

Add custom message field name to zerolog.Context or zerolog.Event will make sense.

mcspring avatar Jun 18 '19 08:06 mcspring