Hi Arnold,
Thank you very much for your reply.
Let me explain our requirement. Our system communicates to the external systems 
for storing and rerieving data. This data has got its own format and all. 
During development and Testing or even production our developers need to 
control the data logging out. So we decided to have a seperate level of log, 
without affecting the defualt levels of log4j. Essencially we need to have a 
log level which is to be turned off and on, doesn't matter whether the defualt 
levels are enabled or not.

Also we don't want to create new branch out of log4j for this. If we can 
accomplish it with adding some new tag/attributes to the log4j.xml or some 
thing like that and use that attribute in the new Logger class (thats what I am 
trying to implement)



-----Original Message-----
From: Curt Arnold [mailto:[EMAIL PROTECTED]
Sent: Tue 12/20/2005 11:33 PM
To: Log4J Users List
Subject: Re: How to add a new  logging level that is  independent of the 
defualt ones.
 

On Dec 20, 2005, at 5:45 AM, Joseph, Shinoy wrote:

>
> Hi,
>     I am in need of adding a new level logging in to the log4j.  
> Requirement is that the new level should be independent of the  
> existing levels(debug,warn,info error,fatal etc).
>
> I have added the new level by extending Level, Logger and  
> LoggingFactory classes.
> Is it possible to do that by customizing log4j.xml ? It will be  
> great if some could guide me in this regard.
>
> Thanks & Regards
> Shinoy

As you've noticed, it isn't easy to do and it makes you maintain a  
branched version of log4j.

In many cases, people add levels for reasons that are much better  
addressed by using the logger hierarchy more effectively.  For  
example, they'd like to add a level SECURITY or AUDIT when that is  
more a description of the intended audience instead of the  
significance of the message to the audience.  In that case, having a  
branch of the logger hierarchy for security related messages  
("security.myapp.foo") is better than logging a message of  
Level.SECURITY to "myapp.foo".

If you explain your requirements, maybe we can find a decent solution  
that doesn't require you maintaining your own branched copy of log4j.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to