How to use winston-logzio - 2 common examples

To help you get started, we’ve selected a few winston-logzio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github breuerfelix / king-bot-api / src / logger.ts View on Github external
format.align(),
			format.printf((x: any) => `${x.level}: ${x.message}`)
		);

		this.log_inst = winston.createLogger({
			level: 'debug',
			format: logFormat,
			transports: [
				new winston.transports.Console()
			]
		});

		this.logz_inst = winston.createLogger({
			level: 'info',
			transports: [
				new logzio_transport({
					level: 'info',
					name: 'king-bot-api',
					token: 'THlrOnExjtQlCfGYWXWSrCrFOdwgmGdh'
				})
			]
		});
	}
github ATLauncher / discord-bot / src / logger.js View on Github external
import winston from 'winston';
import LogzioWinstonTransport from 'winston-logzio';

import { isProductionEnvironment } from './utils';

const hasLogzIoConfig = config.has('logging.logz_io_token');

const logger = winston.createLogger({
    transports: [
        !isProductionEnvironment() && new winston.transports.Console(),
        !hasLogzIoConfig &&
            isProductionEnvironment() &&
            new winston.transports.File({ filename: path.resolve(__dirname, '../logs/server.log') }),
        hasLogzIoConfig &&
            isProductionEnvironment() &&
            new LogzioWinstonTransport({
                level: config.get('logging.level'),
                token: config.get('logging.logz_io_token'),
                format: winston.format.combine(
                    winston.format(info => ({
                        ...info,

                        nodejs: {
                            labels: {
                                app: 'discord-bot',
                            },
                        },
                    }))(),
                    winston.format.json(),
                ),
            }),
    ].filter(Boolean),

winston-logzio

A winston transport wrapper for logzio

Apache-2.0
Latest version published 7 months ago

Package Health Score

72 / 100
Full package analysis

Popular winston-logzio functions