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 Stephen Levinson <St...@sun.com> on 2001/09/20 17:32:54 UTC
Disabling logging from a Configuration File
Hi...
I'm running with configureAndWatch(,,,) reading a configuration file
for logging changes and control.
Is there a way to totally DISABLE all logging .... ( like calling
disableAll() ) ... by means of a setting in my configuration file?
Thanks, Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: Storing hierarchies in log4j.properties
Posted by Ceki Gülcü <cg...@qos.ch>.
Aha! The ProppertyConfigurator.doConfigure method takes a hierarchy as
a second argument. Just look at the code or the SocketServer example. Regards, Ceki
At 18:32 20.09.2001 -0600, T Master wrote:
>Ceki,
>
>In my code, i create two Hierarchy objects:
>e.g.
> Hierarchy h1 = new Hierarchy( Category.getInstance("ONE") );
> Hierarchy h2 = new Hierarchy( Category.getInstance("TWO") );
>I do this so I can separate categories.
>This helps in disabling logging for a certain hierarchy, thus treating
>categories in different hierarchys separately.
>
>This is NOT chained category hierarchy
> e.g.
> log4j.category.one=INFO
> log4j.category.one.child=INFO
>
>
>
>I would like to load up these Hierarchy objects from a property file, and
>associate it to a category , that acts as its root.
>e.g.
> log4j.hierarchy.h1 = ONE
> log4j.hierarchy.h2 = TWO
>
> log4j.category.ONE=INFO
> log4j.category.TWO=INFO
>
>
>
>Is this possible?
>
>T Master.
>
>
>----- Original Message -----
>From: "Ceki Gülcü" <cg...@qos.ch>
>To: "LOG4J Users Mailing List" <lo...@jakarta.apache.org>
>Sent: Thursday, September 20, 2001 5:51 PM
>Subject: Re: Storing hierarchies in log4j.properties
>
>
>>
>> I am afraid I do not understand the question. What do you mean by storing
>hierarchies?
>> Have you read the log4j manual or looked at the examples under
>> src/org/apache/log4j/examples?
>>
>> Regards, Ceki
>>
>> At 17:41 20.09.2001 -0600, T Master wrote:
>> >Ceki ,
>> >
>> >Is it possible to store hierarchys in a log4j.properties file?
>> >If so, how?
>> >
>> >There is no example on the subject.
>> >
>> >T Master
>>
--
Ceki Gülcü - http://qos.ch
The world owes Israel a great debt for destroying Saddam's
French built nuclear reactor in 1981 and thus preventing
nuclear blackmail in the region and perhaps beyond.
-- Garry Kasparov (yes, the chess player)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: Storing hierarchies in log4j.properties
Posted by T Master <tm...@iknowledgeinc.com>.
Ceki,
In my code, i create two Hierarchy objects:
e.g.
Hierarchy h1 = new Hierarchy( Category.getInstance("ONE") );
Hierarchy h2 = new Hierarchy( Category.getInstance("TWO") );
I do this so I can separate categories.
This helps in disabling logging for a certain hierarchy, thus treating
categories in different hierarchys separately.
This is NOT chained category hierarchy
e.g.
log4j.category.one=INFO
log4j.category.one.child=INFO
I would like to load up these Hierarchy objects from a property file, and
associate it to a category , that acts as its root.
e.g.
log4j.hierarchy.h1 = ONE
log4j.hierarchy.h2 = TWO
log4j.category.ONE=INFO
log4j.category.TWO=INFO
Is this possible?
T Master.
----- Original Message -----
From: "Ceki Gülcü" <cg...@qos.ch>
To: "LOG4J Users Mailing List" <lo...@jakarta.apache.org>
Sent: Thursday, September 20, 2001 5:51 PM
Subject: Re: Storing hierarchies in log4j.properties
>
> I am afraid I do not understand the question. What do you mean by storing
hierarchies?
> Have you read the log4j manual or looked at the examples under
> src/org/apache/log4j/examples?
>
> Regards, Ceki
>
> At 17:41 20.09.2001 -0600, T Master wrote:
> >Ceki ,
> >
> >Is it possible to store hierarchys in a log4j.properties file?
> >If so, how?
> >
> >There is no example on the subject.
> >
> >T Master
>
> --
> Ceki Gülcü - http://qos.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: Storing hierarchies in log4j.properties
Posted by Ceki Gülcü <cg...@qos.ch>.
I am afraid I do not understand the question. What do you mean by storing hierarchies?
Have you read the log4j manual or looked at the examples under
src/org/apache/log4j/examples?
Regards, Ceki
At 17:41 20.09.2001 -0600, T Master wrote:
>Ceki ,
>
>Is it possible to store hierarchys in a log4j.properties file?
>If so, how?
>
>There is no example on the subject.
>
>T Master
--
Ceki Gülcü - http://qos.ch
The world owes Israel a great debt for destroying Saddam's
French built nuclear reactor in 1981 and thus preventing
nuclear blackmail in the region and perhaps beyond.
-- Garry Kasparov (yes, the chess player)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Storing hierarchies in log4j.properties
Posted by T Master <tm...@iknowledgeinc.com>.
Ceki ,
Is it possible to store hierarchys in a log4j.properties file?
If so, how?
There is no example on the subject.
T Master
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: Disabling logging from a Configuration File
Posted by Ceki Gülcü <cg...@qos.ch>.
Please, try
log4j.disable=FATAL
this will become
log4j.enable=OFF
in log4j version 1.2.
Hope this helps, Ceki
At 11:30 20.09.2001 -0600, you wrote:
>As far as i know, it must be done through Hierarchy.disableAll() and
>Hierarchy.disableAll(Priority)
>Hierarchy.enableAll() can be called afterwards when required.
>
>
>----- Original Message -----
>From: "Stephen Levinson" <St...@sun.com>
>To: "'LOG4J Users Mailing List'" <lo...@jakarta.apache.org>
>Sent: Thursday, September 20, 2001 9:32 AM
>Subject: Disabling logging from a Configuration File
>
>
>> Hi...
>> I'm running with configureAndWatch(,,,) reading a configuration file
>> for logging changes and control.
>>
>> Is there a way to totally DISABLE all logging .... ( like calling
>> disableAll() ) ... by means of a setting in my configuration file?
>>
>>
>> Thanks, Stephen
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
--
Ceki Gülcü - http://qos.ch
The world owes Israel a great debt for destroying Saddam's
French built nuclear reactor in 1981 and thus preventing
nuclear blackmail in the region and perhaps beyond.
-- Garry Kasparov (yes, the chess player)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: Disabling logging from a Configuration File
Posted by T Master <tm...@iknowledgeinc.com>.
As far as i know, it must be done through Hierarchy.disableAll() and
Hierarchy.disableAll(Priority)
Hierarchy.enableAll() can be called afterwards when required.
----- Original Message -----
From: "Stephen Levinson" <St...@sun.com>
To: "'LOG4J Users Mailing List'" <lo...@jakarta.apache.org>
Sent: Thursday, September 20, 2001 9:32 AM
Subject: Disabling logging from a Configuration File
> Hi...
> I'm running with configureAndWatch(,,,) reading a configuration file
> for logging changes and control.
>
> Is there a way to totally DISABLE all logging .... ( like calling
> disableAll() ) ... by means of a setting in my configuration file?
>
>
> Thanks, Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org