Closed Dru-Go closed 10 months ago
The Error looks like the following
{"@t":"2023-10-17T18:53:34.2890000Z","@mt":"[seq] Circular structure found","@m":"[seq] Circular structure found","@i":"f91a6406","@l":"Error"}
My Logger setup is the following
import { createLogger, format, transports } from 'winston' import { TransformableInfo } from 'logform' import { SeqTransport } from '@datalust/winston-seq' // Define log format const customFormat = format.printf((info: TransformableInfo) => { const { timestamp, level, message, stack } = info return `${timestamp} [${level}]: ${message} ${stack || ''}` }) // Define transports const commonTransport = new transports.File({ filename: 'logs/common.log' }) const errorTransport = new transports.File({ filename: 'logs/error.log', level: 'error' }) // Define log transports const transportsArray = [ new transports.Console(), new SeqTransport({ serverUrl: "http://localhost:5341", onError: (e => { console.error(e) }), handleExceptions: true, handleRejections: true, }), commonTransport, errorTransport ] // Create logger instance const logger = createLogger({ level: 'info', defaultMeta: { application: 'Noah Server' }, format: format.combine( format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), format.errors({ stack: true }), format.splat(), format.json(), customFormat ), transports: transportsArray }) export default logger
This message refers to the data being logged. You can't log an object that refers to an object that refers back to the first object because it can't be serialized.
Thank you
You're welcome.
The Error looks like the following
My Logger setup is the following