Skip to content

AppLogService makes it too easy to swallow a stacktrace #151

Open
@jonenst

Description

@jonenst

There are at least hundreds of places in our codebase where the code reads like

try
{
...
}
catch ( Exception e )
{
    AppLogService.error( e )
}

This swallows the exception stacktrace.

SLF4J decided against accepting object as an input to a log method because of this : https://www.slf4j.org/faq.html#string_or_object
(although log4j2 still has this API..)

What about adding a new override to AppLogService like this ?

public static void error( Throwable t )
{
            _loggerErrors.error( t, t );
}

If people really want to log only the exception name, then they can do AppLogService.error ( e.toString() );

@rzara @pierrelevy ?

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