Understand the `info` object and metadata
masterIn winston, log messages are handled as info objects within an objectMode stream. Every info object must contain at least a level and a message property.
Any additional properties provided are treated as meta (metadata).
Important Note on Message Concatenation:
If you provide a message property inside a metadata object, winston will automatically concatenate it to the primary message. For example:
logger.info('hello', { message: 'world' }); results in a message of 'hello world'.
Commonly added properties by formats:
splat: Used bysplat()for string interpolation (%d,%s).timestamp: Added bytimestamp().label: Added bylabel().ms: Added byms()(milliseconds since last log).
// The structure of an info object
const info = {
level: 'info', // Level of the logging message
message: 'Hey! Log something?', // Descriptive message
requestId: '123' // Custom metadata
};