winston#LoggerOptions TypeScript Examples
The following examples show how to use
winston#LoggerOptions.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: logger.ts From one-platform with MIT License | 6 votes |
winstonOptions: LoggerOptions = {
transports: [
new transports.Console(),
],
format: format.combine(
format.timestamp(),
format.json(),
),
silent: NODE_ENV === 'test',
}
Example #2
Source File: Logger.ts From jaebook-server with MIT License | 6 votes |
options: LoggerOptions = {
level,
exitOnError: false,
format: combine(
timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
errors({ stack: true }),
),
transports: [
// 콘솔 로그 출력
new transports.Console({
handleExceptions: true,
format: consoleOutputFormat,
}),
// 파일 로그 출력
new DailyRotateFile({
handleExceptions: true,
format: fileOutputFormat,
filename,
}),
],
}
Example #3
Source File: logger.ts From remix-project with MIT License | 6 votes |
setVerbosity (v: LoggerOptions['level']): void {
this.logger.configure({
level: v,
transports: [new winston.transports.Console()],
format: winston.format.combine(
winston.format.colorize({ all: true }),
logFmt
)
})
}
Example #4
Source File: logger.ts From one-platform with MIT License | 5 votes |
winstonOptions: LoggerOptions = {
transports: [new transports.Console()],
format: format.combine(format.timestamp(), format.json()),
silent: NODE_ENV === 'test',
}
Example #5
Source File: logger.service.ts From barista with Apache License 2.0 | 5 votes |
overrideOptions(options: LoggerOptions) {
this.logger.configure(options);
}
Example #6
Source File: logger.service.ts From barista with Apache License 2.0 | 5 votes |
public static loggerOptions: LoggerOptions = {
transports: [new winston.transports.Console()],
};
Example #7
Source File: rootLogger.ts From backstage with Apache License 2.0 | 5 votes |
/**
* Creates a default "root" logger. This also calls {@link setRootLogger} under
* the hood.
*
* @remarks
*
* This is the logger instance that will be the foundation for all other logger
* instances passed to plugins etc, in a given backend.
*
* @public
*/
export function createRootLogger(
options: winston.LoggerOptions = {},
env = process.env,
): winston.Logger {
const logger = winston.createLogger(
merge<LoggerOptions, LoggerOptions>(
{
level: env.LOG_LEVEL || 'info',
format: winston.format.combine(
winston.format(redactLogLine)(),
env.NODE_ENV === 'production' ? winston.format.json() : coloredFormat,
),
defaultMeta: {
service: 'backstage',
},
transports: [
new winston.transports.Console({
silent: env.JEST_WORKER_ID !== undefined && !env.LOG_LEVEL,
}),
],
},
options,
),
);
setRootLogger(logger);
return logger;
}
Example #8
Source File: index.ts From backend-postgres-typescript-node-express with MIT License | 5 votes |
loggerOptions: LoggerOptions