Skip to content

Logging error object fails #46

@michaelw85

Description

@michaelw85
TypeError: Cannot read property 'split' of undefined
    at graylog.log [as _log] (/Users/.....node_modules/graylog2/graylog.js:146:34)
    at graylog.error (/Users/.....node_modules/graylog2/graylog.js:93:17)

Graylog code:

    } else if (short_message.stack && short_message.message) {

        // Short message is an Error message, we process accordingly
        message.short_message = short_message.message;
        message.full_message  = short_message.stack;

        // extract error file and line
        fileinfo = message.stack.split('\n')[0];

Looking at this, the last line message.stack should be short_message.stack.
Message is a newly build object within the library which does not contain a stack trace by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions