Re: How to configure logging in embedded Tomcat?

2011-06-24 Thread Rüdiger Herrmann
In the meanwhile, I found a way to work around the problem. Just for the record:

Tomcat uses plain JDK logging, so one can obtain a logger with
Logger#getLogger() and change its settings before Tomcat obtains a
reference. As loggers are held in WeakReferences, you only need to
make sure that they are not GC'ed. (Note: I use embedded Tomcat in
tests and thus can affort to hold on some Logger instances, this is
probably not a good idea for production evironments)

The code could look like this:
  static final List loggerHolder = new LinkedList();

  Logger logger = Logger.getLogger( "name.of.Logger" );
  loggerHolder.add( logger );
  logger.setLevel( Level.SEVERE );

On Tue, Jun 14, 2011 at 18:15, Rüdiger Herrmann
 wrote:
> ups, sorry. I am using version 7.
>
> On Tue, Jun 14, 2011 at 18:03, Mark Thomas  wrote:
>> On 14/06/2011 16:24, Rüdiger Herrmann wrote:
>>> Hi all,
>>>
>>> I am running Tomcat embedded and just can't figure out how to
>>> programmatically configure the logging of the engine itself.
>>> Ideally I would redirect logging to a custom implementation, but
>>> changing the log level (to off) would already help.
>>> The LogFactory doesn't seem to offer such functionality (?) and
>>> manipulating the underlying java.util.logging.Logger didn't help
>>> either.
>>> Any insights?
>>
>> Without you telling us the Tomcat version you are using, insight is
>> unlikely.
>>
>> Mark
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>
>
>
> --
> --
> EclipseSource
> http://eclipsesource.com
> Tel: 0721 - 66 47 33 - 0
> Fax: 0721 - 66 47 33 29
>
> Innoopract Informationssysteme GmbH
> Stephanienstrasse 20, 76133 Karlsruhe, Germany
> General Manager: Jochen Krause
> Registered Office: Karlsruhe, Commercial Register Mannheim HRB 107883
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to configure logging in embedded Tomcat?

2011-06-14 Thread Rüdiger Herrmann
ups, sorry. I am using version 7.

On Tue, Jun 14, 2011 at 18:03, Mark Thomas  wrote:
> On 14/06/2011 16:24, Rüdiger Herrmann wrote:
>> Hi all,
>>
>> I am running Tomcat embedded and just can't figure out how to
>> programmatically configure the logging of the engine itself.
>> Ideally I would redirect logging to a custom implementation, but
>> changing the log level (to off) would already help.
>> The LogFactory doesn't seem to offer such functionality (?) and
>> manipulating the underlying java.util.logging.Logger didn't help
>> either.
>> Any insights?
>
> Without you telling us the Tomcat version you are using, insight is
> unlikely.
>
> Mark
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>



-- 
--
EclipseSource
http://eclipsesource.com
Tel: 0721 - 66 47 33 - 0
Fax: 0721 - 66 47 33 29

Innoopract Informationssysteme GmbH
Stephanienstrasse 20, 76133 Karlsruhe, Germany
General Manager: Jochen Krause
Registered Office: Karlsruhe, Commercial Register Mannheim HRB 107883

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to configure logging in embedded Tomcat?

2011-06-14 Thread Mark Thomas
On 14/06/2011 16:24, Rüdiger Herrmann wrote:
> Hi all,
> 
> I am running Tomcat embedded and just can't figure out how to
> programmatically configure the logging of the engine itself.
> Ideally I would redirect logging to a custom implementation, but
> changing the log level (to off) would already help.
> The LogFactory doesn't seem to offer such functionality (?) and
> manipulating the underlying java.util.logging.Logger didn't help
> either.
> Any insights?

Without you telling us the Tomcat version you are using, insight is
unlikely.

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



How to configure logging in embedded Tomcat?

2011-06-14 Thread Rüdiger Herrmann
Hi all,

I am running Tomcat embedded and just can't figure out how to
programmatically configure the logging of the engine itself.
Ideally I would redirect logging to a custom implementation, but
changing the log level (to off) would already help.
The LogFactory doesn't seem to offer such functionality (?) and
manipulating the underlying java.util.logging.Logger didn't help
either.
Any insights?

TIA
Rüdiger

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org