At 19:56 17.07.2001 +0200, you wrote:
>Hi Reshma,
>
>i've done this on my project, you can have a look at it
>
>  * for the user doc: 
>      http://raccoon.sourceforge.net/userGuide1.html#Log
>
>  * the class itself is here: 
>      http://raccoon.sourceforge.net/javadoc/raccoon/service/log/LogState.html
>
>hope this helps,
>
>cedric
>
>Quoting Reshma Badadhe <[EMAIL PROTECTED]>:
>
>> Hi,
>> I am looking into the approach suggested by Van  i.e making logging a
>> static
>> utility class. I have a Logger class which is as follows:
>> 
>> public class Logger
>> {
>>       //this instance is used for logging to a Trace log
>>       static public Category traceCat = Category.getInstance("Trace" +
>> Logger.class.getName());
>>       //this instance is used for logging to an Error log
>>       static public Category errCat = Category.getInstance("Error" +
>> Logger.class.getName());
>> 
>>       static
>>       {
>>               PropertyConfigurator.configureAndWatch("xxx.cfg",60000);
>>       }
>> 
>> }
>> 
>> This class can be then used by other modules that want to log messages.
>> But
>> i have some million-dollar questions to ask u "Know-It-Alls" ;-) 
>> 
>> #1) I want the appender corresponding to the traceCat instance to log
>> only
>> debug and info messages i.e in the Trace log. 
>> PropertyConfigurator doesnt support filters. And i tried adding code to
>> do
>> so but failed. 
>> So what options do i have?
>> #2) I thought of adding a Constructor to use the single instance
>> approach.
>> Will this help in logging messages to same logfile in an appserver
>> environment ( message:  "Multiple JVMs writing to one log file"). For
>> the
>> same reason, i've used the static initializer to configure the logging
>> environment. Does this approach have any flaws?

Well yes. It is like owning an automobile but pushing it on foot out of 
fear of wearing the tires. I fail to see the logic. 


--
Ceki Gülcü - http://qos.ch


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

Reply via email to