Type for additional fields in a log event.
It is a plain object with string, number, Date, or function values.
Functions are expected to return a string when called.
This allows for dynamic content in log events.
Type declaration
[key: string]:string|number|Date| (()=>string)
Param: key
The name of the field.
Returns
The value of the field, which can be a string, number, Date, or a function that returns a string.
Remarks
Functions should be used for dynamic values that need to be evaluated at the time of logging.
Avoid using complex objects or large data structures to keep log events lightweight.
Type for additional fields in a log event. It is a plain object with string, number, Date, or function values. Functions are expected to return a string when called. This allows for dynamic content in log events.