How to use the stdTimeFunctions function from pino

Find comprehensive JavaScript pino.stdTimeFunctions code examples handpicked from public code repositorys.

177
178
179
180
181
182
183
184
185
186
				 */
				res.headersSent = true;
				return pino.stdSerializers.res(res);
			},
		},
		timestamp: () => pino.stdTimeFunctions.isoTime(),
	},
	ignoreTrailingSlash: true,
},
cors: {
fork icon2
star icon11
watch icon0

51
52
53
54
55
56
57
58
59
60
61
const logger = pino({
  name: 'currencyservice-server',
  messageKey: 'message',
  changeLevelName: 'severity',
  useLevelLabels: true,
  timestamp: pino.stdTimeFunctions.unixTime
});


/**
 * Helper function that loads a protobuf file.
fork icon1
star icon0
watch icon0

21
22
23
24
25
26
27
28
29
30
const logger = pino({
  name: 'paymentservice',
  messageKey: 'message',
  changeLevelName: 'severity',
  useLevelLabels: true,
  timestamp: pino.stdTimeFunctions.unixTime,
  mixin() {
    const span = tracer.getCurrentSpan();
    if (!span) {
      return {};
fork icon1
star icon0
watch icon0

15
16
17
18
19
20
21
22
23
24
        },
      },
    customLevels: levels, // our defined levels
    useOnlyCustomLevels: true,
    level: 'info',
    timestamp: pino.stdTimeFunctions.isoTime,
   
  },
  pino.destination(`${__dirname}/../server.log`)
)
fork icon0
star icon0
watch icon0