Thanks. I've looked at logweb and I'd rather not use it. 
Seems too bulky for this one little thing that we need.
Plus we're not a struts based app. So do not want to add a whole new
framework for this.
And the other possibility is a whole new webapp which seems like an
unnecessary overhead as well.

I appreciate all ideas.


-----Original Message-----
From: James Stauffer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 12, 2006 1:27 PM
To: Log4J Users List
Subject: Re: Programmatic threshold change

You may want to look into LogWeb
(http://www.codeczar.com/products/logweb/index.html) to see if that
meets your needs or gives you clues.

On 7/12/06, Sharma, Siddharth <[EMAIL PROTECTED]> wrote:
> Greetings
>
> In log4j.xml, we have set the threshold to be 'INFO'.
> We have written a servlet that takes the log level as a parameter and
> dynamically changes log4j's log level.
> This is to facilitate bumping the log level up on-demand when an exception
> occurs to capture more information.
>
> Here is the code:
> LoggerRepository logRepository = LogManager.getLoggerRepository();
> logRepository.setThreshold(someLogLevel);
>
>
> But I find that the log4j does not get configured at runtime to log at a
> level lower than what is defined in log4j.xml.
> In other words, I can successfully change to WARN, ERROR or FATAL and then
> back down to INFO, but I cannot change it to DEBUG (since log4j.xml has
> INFO).
>
> I am hoping this is possible to do and will appreciate the code that will
> achieve this.
> I can certainly change log4j.xml to have a threshold of DEBUG and then
> programmatically change it to INFO during server startup. But I'd rather
not
> do it that way since it is a HACK!
>
> Thanks in advance
> Sid
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

---------------------------------------------------------------------
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