Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppLogService makes it too easy to swallow a stacktrace #151

Open
jonenst opened this issue Sep 12, 2018 · 1 comment
Open

AppLogService makes it too easy to swallow a stacktrace #151

jonenst opened this issue Sep 12, 2018 · 1 comment

Comments

@jonenst
Copy link
Member

jonenst commented Sep 12, 2018

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 ?

@jonenst
Copy link
Member Author

jonenst commented Sep 12, 2018

Note that this will not change the behavior of the logs in the plugins until they are recompiled against the new core (but at least it is binary compatible)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant