Skip to content

Logging Objects or Errors is not working #49

@Starfox64

Description

@Starfox64
'use strict';

const winston = require('winston');
const Graylog = require('winston-graylog2');

const logger = new winston.Logger({
	level: 'debug',
	transports: [
		new Graylog({
			level: 'debug',
			handleExceptions: true,
			graylog: {
				servers: [{ host: '10.42.221.139', port: 12201 }],
				facility: 'debug-test'
			}
		})
	]
});


logger.info('Text Test');
logger.debug({foo: 'bar'});
logger.error(new Error());
logger.error(new Error('Test Error'));

setTimeout(() => {process.exit(0)}, 1000);

When running the following script, the first test is the only one inserted in Graylog.

Graylog

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions