I just run it when I need to change the log level.
Mark Thomas wrote:
>
> On 22/06/2011 16:16, Roshni Basu wrote:
>>
>> I have created a java file. And running this. Could you elaborate what
>> exactly you want to know?
>
> I want to know how this code is being executed. When does it run? What
> triggers it?
>
> Mark
>
>>
>> Mark Thomas wrote:
>>>
>>> On 22/06/2011 16:03, Roshni Basu wrote:
>>>>
>>>> Tomcat version is 6.0.9.
>>>> Here is my snippet of code:
>>>>
>>>> LogManager logManager = LogManager.getLogManager();
>>>> Enumeration<String> e = logManager.getLoggerNames();
>>>> while (e.hasMoreElements())
>>>> {
>>>> String loggername = e.nextElement();
>>>> Logger logger = logManager.getLogger(loggername);
>>>> Handler[] handlers = logger.getHandlers();
>>>> if (handlers != null && handlers.length != 0)
>>>> {
>>>> for (Handler h : handlers)
>>>> {
>>>> h.setLevel(Level.WARNING);
>>>> }
>>>> logger.setLevel(Level.WARNING);
>>>> }
>>>> }
>>>
>>> Which is running where exactly?
>>>
>>> Mark
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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]
>
>
>
--
View this message in context:
http://old.nabble.com/Tomcat-Logging-level-change-tp31902405p31904220.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]