logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Javier Gonzalez <jagon...@gmail.com>
Subject Re: Wrapping logger
Date Wed, 08 Feb 2006 18:47:26 GMT
On 2/8/06, DeSantis, MJ Mark @ IS (7179) <Mark.J.DeSantis@l-3com.com> wrote:
>
> is for nice, user-friendly, user-understandable, messages. So in other
> words
> if we, for instance, caught an exception and wanted the stacktrace to go
> to
> the file but we still wanted something for the user to show up in the
> window
> we would do something like this:
>
> }catch(Exception ex){
>         ourLogger.fatal("Problem in such-and-such a window: ", ex);
>         ourLogger.advisoryFatal("The window can not display because of
> xyz");
> }
>
>
> So that's pretty much the situation.
>
> Do you think refactoring to a less "extended" approach is a possibility.
>

At first glance, I'd propose using two loggers:

}catch(Exception ex){
        // traditional logger, with stack trace
        ourLogger.fatal("Problem in such-and-such a window: ", ex);
        // user friendly logger, with verbose messages and no stack trace
        ourAdvisoryLogger.fatal("The window can not display because of
xyz");
}

And then tweak the appenders configuration and such for "ourAdvisoryLogger"
to get the results you had with the extended Logger.

--
Javier González Nicolini

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message