You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Trent Mick <tr...@ActiveState.com> on 2002/02/18 22:52:14 UTC

survey: Is the FATAL priority level useful?

Hello,

I am currently specing out a core logging module for the Python language
which borrows from log4j. I would like to know if, in practice, people have
found the FATAL priority level of use in a language with exception handling
support.

The way I see it (not having the benefit of experience) the ERROR level is
useful for identifying errors in user input before terminating processing (or
stumbling along afterward). A FATAL problem is typically just an uncaught
exception -- and if the exception is uncaught there really seems no
appropriate to actually *log* the problem.

The only appropriate senario that I see is having one exception catch
block around my entire application which will log a FATAL error for any
unexpected exception.

    public class MyApp {
        static Logger logger = Logger.getLogger(MyApp.class);

        public static void main(String[] args) {
            try {
                return dostuff();
            } catch (Throwable t) {
                logger.fatal("Something really bad happened.");
            }
        }
    }

Are there other usage scenarios for which people have found FATAL to be
handy.

Thanks,
Trent


-- 
Trent Mick
TrentM@ActiveState.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: survey: Is the FATAL priority level useful?

Posted by Trent Mick <tr...@ActiveState.com>.
On Mon, Feb 18, 2002 at 11:16:51PM +0100, Ceki Gülcü wrote:
> Trent,
> 
> The following quote is from the log4j book I am currently writing. You might
> find the quote useful.
<snip>

Thanks, Ceki! That is helpful.

Trent

-- 
Trent Mick
TrentM@ActiveState.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: survey: Is the FATAL priority level useful?

Posted by Ceki Gülcü <ce...@qos.ch>.
Trent,

The following quote is from the log4j book I am currently writing. You might
find the quote useful.

It is not always easy to decide when to use which level. In fact, a
decision needs to be made on each logging statement - that is on
countless occasions. To ease the pain of deciding, log4j deliberately
offers a limited set of "self-evident" levels. The FATAL level is
rarely used and usually implies the impending crash of the application
or the relevant sub-component. The ERROR level is encountered more
frequently, usually following a Java exception. Error conditions do
not necessarily cause the application to crash and the application may
continue to service subsequent requests. The WARN level is indicative
of minor problems caused by factors external to the application such
as missing or inconsistent input parameters supplied by the user.

These first three levels, are associated with problems. In contrast,
the INFO level is associated with significant events in the normal
life-cycle of the application. The DEBUG level is associated with
minor and frequently occurring but otherwise normal events.  Deciding
whether an event is significant or minor depends on many factors such
as the time, the application development stage, the component doing
the logging and the personal tastes of the developer. In the general
however, the frequency of the events is a useful yardstick for
differentiating between the INFO and DEBUG levels.  Admittedly, even
with only five levels the choice is not easy. After some discussion,
most development teams set their own rules for using levels. Some
teams even decide to extend the predefined set of five levels. It is
important to realize that levels are fundamentally just a way to
filter log requests; that is their main function.

Regards, Ceki

At 13:52 18.02.2002 -0800, Trent Mick wrote:

>Hello,
>
>I am currently specing out a core logging module for the Python language
>which borrows from log4j. I would like to know if, in practice, people have
>found the FATAL priority level of use in a language with exception handling
>support.
>
>The way I see it (not having the benefit of experience) the ERROR level is
>useful for identifying errors in user input before terminating processing (or
>stumbling along afterward). A FATAL problem is typically just an uncaught
>exception -- and if the exception is uncaught there really seems no
>appropriate to actually *log* the problem.
>
>The only appropriate senario that I see is having one exception catch
>block around my entire application which will log a FATAL error for any
>unexpected exception.
>
>     public class MyApp {
>         static Logger logger = Logger.getLogger(MyApp.class);
>
>         public static void main(String[] args) {
>             try {
>                 return dostuff();
>             } catch (Throwable t) {
>                 logger.fatal("Something really bad happened.");
>             }
>         }
>     }
>
>Are there other usage scenarios for which people have found FATAL to be
>handy.
>
>Thanks,
>Trent


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>