Skip to content

nsuite v2.2.1


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

ts
import { withTimeout } from "nsuite";
const newPromise = withTimeout(promise, 3000);

Properties

enableConsole?

optional enableConsole?: boolean

Defined in: UtilsLog.ts:111


filename?

optional filename?: string

Defined in: UtilsLog.ts:108


includeCallSite?

optional includeCallSite?: boolean

Defined in: UtilsLog.ts:112


inspector?

optional inspector?: "nodeInspect" | "objectInspect"

Defined in: UtilsLog.ts:113


level?

optional level?: string

Defined in: UtilsLog.ts:106


maxLength?

optional maxLength?: number

Defined in: UtilsLog.ts:109


meta?

optional meta?: Record<string, string>

Defined in: UtilsLog.ts:107


zippedArchive?

optional zippedArchive?: boolean

Defined in: UtilsLog.ts:110

Released under the Apache-2.0 License.