spec(backend): severityのラベルをJSON形式のログに追加 (MisskeyIO#425)

This commit is contained in:
まっちゃとーにゅ 2024-02-10 00:14:44 +09:00 committed by GitHub
parent 258a17cb64
commit 235d8d9433
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,6 +31,9 @@ export default class Logger {
timestamp: envOption.withLogTime || envOption.logJson ? pino.stdTimeFunctions.isoTime : false, timestamp: envOption.withLogTime || envOption.logJson ? pino.stdTimeFunctions.isoTime : false,
messageKey: 'message', messageKey: 'message',
errorKey: 'error', errorKey: 'error',
formatters: {
level: (label, number) => ({ severity: label, level: number }),
},
mixin: () => ({ cluster: cluster.isPrimary ? 'primary' : `worker#${cluster.worker!.id}` }), mixin: () => ({ cluster: cluster.isPrimary ? 'primary' : `worker#${cluster.worker!.id}` }),
transport: !envOption.logJson ? { transport: !envOption.logJson ? {
target: 'pino-pretty', target: 'pino-pretty',