Skip to content

Missing stack traces and some questions #21

Description

@arggh

Missing stack trace

If I catch an error on the client and attempt to log it like so:

logger.error('Something wonky happened', { error: e });

Then, the entry in DB is missing the stack trace. The error object only consists of properties line, column, sourceURL.

If I include the stack trace in the context manually like so:

logger.error('Something wonky happened', {
   stack: e.stack,
   error: e
});

-> Stack trace is present in the DB entry.

Is this intentional, if so, what is the reasoning behind it?

Logging the error objects

What about logging errors like so:

try {
   something();
} catch (e) {
   // something something if condition
   ...
   // I've no clue what happened, better just log the whole error
   logger.error(e);
}

This produces an error log entry that's not helpful at all:

{
    "level": 3,
    "message": "[object Object]",
    "context": {
        // ...whatever processors you had

Is there a reason FiLog is not producing sensible output from this type of use?

Completely swallowing the error event

Should I try to log like this:

logger.error(error.message, error);

I get nothing logged, console or DB. It just silently does nothing. This is a bit dangerous, no?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions