nsuite / CreateLoggerOptions
Interface: CreateLoggerOptions
Defined in: UtilsLog.ts:105
Creates a Winston logger with a daily rotating file transport and optional console transport.
Param
options
Configuration options for the logger.
Param
options.level
The log level.
Param
options.meta
The name of the server.
Param
options.filename
The filename pattern for the log files.
Param
options.maxLength
The maximum length of the log message.
Param
options.zippedArchive
Whether to zip old log files.
Param
options.enableConsole
Whether to enable console logging.
Param
options.includeCallSite
Whether to include the call site in the log message.
Param
options.inspector
The inspector function to use for formatting log messages. Support 'nodeInspect' or 'objectInspect'
Param
promise
The promise to wrap with a timeout.
Param
timeoutMs
The timeout duration in milliseconds.
Example
import { withTimeout } from "nsuite";
const newPromise = withTimeout(promise, 3000);Properties
enableConsole?
optionalenableConsole?:boolean
Defined in: UtilsLog.ts:111
filename?
optionalfilename?:string
Defined in: UtilsLog.ts:108
includeCallSite?
optionalincludeCallSite?:boolean
Defined in: UtilsLog.ts:112
inspector?
optionalinspector?:"nodeInspect"|"objectInspect"
Defined in: UtilsLog.ts:113
level?
optionallevel?:string
Defined in: UtilsLog.ts:106
maxLength?
optionalmaxLength?:number
Defined in: UtilsLog.ts:109
meta?
optionalmeta?:Record<string,string>
Defined in: UtilsLog.ts:107
zippedArchive?
optionalzippedArchive?:boolean
Defined in: UtilsLog.ts:110