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 Bret Schuhmacher <br...@ingrian.com> on 2007/04/04 18:17:42 UTC

I don't like the word "FATAL"

There are messages I want to print all the time, such as entry/exit into
main(), regardless what threshold the user has set.  I've been doing
this with logger.fatal().  Unfortunately, this prints "FATAL" in your
simple message, which alarms the *hell* out of customers.  Even though
the message says something innocuous like "Entering main - processing
beginning", I've had customers require huge write-ups explaining that
FATAL isn't actually a FATAL error.  Is there a way to either change the
word "FATAL" or get a message to print in all circumstances without the
word FATAL appearing?  As I'm writing this, I'm all of a sudden thinking
that I could use a different logger with a different conversionpattern,
one without the level in it.  Is that how others do this?

Thanks!

Bret


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: I don't like the word "FATAL"

Posted by Curt Arnold <ca...@apache.org>.
On Apr 4, 2007, at 11:17 AM, Bret Schuhmacher wrote:

> There are messages I want to print all the time, such as entry/exit  
> into
> main(), regardless what threshold the user has set.  I've been doing
> this with logger.fatal().  Unfortunately, this prints "FATAL" in your
> simple message, which alarms the *hell* out of customers.  Even though
> the message says something innocuous like "Entering main - processing
> beginning", I've had customers require huge write-ups explaining that
> FATAL isn't actually a FATAL error.  Is there a way to either  
> change the
> word "FATAL" or get a message to print in all circumstances without  
> the
> word FATAL appearing?  As I'm writing this, I'm all of a sudden  
> thinking
> that I could use a different logger with a different  
> conversionpattern,
> one without the level in it.  Is that how others do this?
>
> Thanks!
>
> Bret
>


You could use the ALL level which is even higher than FATAL:

logger.log(Level.ALL, "Just try to stop me");






---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: I don't like the word "FATAL"

Posted by James Stauffer <st...@gmail.com>.
It it works in your situation I would use a different logger.

On 4/4/07, Bret Schuhmacher <br...@ingrian.com> wrote:
> There are messages I want to print all the time, such as entry/exit into
> main(), regardless what threshold the user has set.  I've been doing
> this with logger.fatal().  Unfortunately, this prints "FATAL" in your
> simple message, which alarms the *hell* out of customers.  Even though
> the message says something innocuous like "Entering main - processing
> beginning", I've had customers require huge write-ups explaining that
> FATAL isn't actually a FATAL error.  Is there a way to either change the
> word "FATAL" or get a message to print in all circumstances without the
> word FATAL appearing?  As I'm writing this, I'm all of a sudden thinking
> that I could use a different logger with a different conversionpattern,
> one without the level in it.  Is that how others do this?
>
> Thanks!
>
> Bret
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: I don't like the word "FATAL"

Posted by Er...@bcbsks.com.



There are messages I want to print all the time, such as entry/exit into
main(), regardless what threshold the user has set.  I've been doing
this with logger.fatal().  Unfortunately, this prints "FATAL" in your
simple message, which alarms the *hell* out of customers.  Even though
the message says something innocuous like "Entering main - processing
beginning", I've had customers require huge write-ups explaining that
FATAL isn't actually a FATAL error.  Is there a way to either change the
word "FATAL" or get a message to print in all circumstances without the
word FATAL appearing?  As I'm writing this, I'm all of a sudden thinking
that I could use a different logger with a different conversionpattern,
one without the level in it.  Is that how others do this?

Thanks!

Bret
-----------------------------------------------------------------------------------------------------------------------------------------
Response:

I would create a new "root" logger in your config file and use it to do
INFO messages and set
the threshold to INFO.  My example is below

# WAMLogger is a Logger used to create an Audit trail for WAM usage
# Use below line in the classes to log to this Logger:
# Logger wamLog = Logger.getLogger("WAMLogger." +
ClassName.class.getName());
log4j.logger.WAMLogger=INFO, WAMRolling

# WAMRolling is a Rolling File Appender that outputs log records to a
rolling log file named wam_Rolling_log
log4j.appender.WAMRolling=org.apache.log4j.RollingFileAppender
log4j.appender.WAMRolling.File=C:\\logs\\wam\\wam_audit_log
log4j.appender.WAMRolling.layout=org.apache.log4j.PatternLayout
log4j.appender.WAMRolling.layout.ConversionPattern=[%d{ISO8601}]   %30.80
c{9} -- %x%n  ** Audit Message: %m%n

# Set the max size of the file, the number of backup files and logging
threshold
log4j.appender.WAMRolling.MaxFileSize=10MB
log4j.appender.WAMRolling.MaxBackupIndex=10
log4j.appender.WAMRolling.Threshold=INFO

In the above config file example, if I log to wamLog.info(), I will always
get the log record to come out no
matter what the root logger setting.  The "WAMLogger." becomes another
"root" logger and will still
have the class name in the category with "WAMLogger." as a prefix.  This is
a great solution for many
things once someone showed it to me last month.

Eric Wolf


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE : I don't like the word "FATAL"

Posted by Ionel GARDAIS <ig...@yahoo.fr>.
Hi,

You could create your own level with the same priority
than Level.FATAL

Ionel


--- Bret Schuhmacher <br...@ingrian.com> a écrit :

> There are messages I want to print all the time,
> such as entry/exit into
> main(), regardless what threshold the user has set. 
> I've been doing
> this with logger.fatal().  Unfortunately, this
> prints "FATAL" in your
> simple message, which alarms the *hell* out of
> customers.  Even though
> the message says something innocuous like "Entering
> main - processing
> beginning", I've had customers require huge
> write-ups explaining that
> FATAL isn't actually a FATAL error.  Is there a way
> to either change the
> word "FATAL" or get a message to print in all
> circumstances without the
> word FATAL appearing?  As I'm writing this, I'm all
> of a sudden thinking
> that I could use a different logger with a different
> conversionpattern,
> one without the level in it.  Is that how others do
> this?
> 
> Thanks!
> 
> Bret
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail:
> log4j-user-help@logging.apache.org
> 
> 



	

	
		
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org