2014-01-31 Ja kub <jjaku...@gmail.com>:
> changing logging level in logging properties works fine, but my custom
> logger is not visible in jconsole under java.util.logging -> loggerNames, I
> can't change logging level dynamically by jconsole
>
> I add into logging properties
> test.logging.LoggingTest .level = FINE
> and it successfully changes logs appearing in log file.
>
> below is class used for logging
>
> public class LoggingTest {
>
>
>   Logger logger = Logger.getLogger(LoggingTest .class.getName());
>
>   public LoggingTest () {
>
>   }
>
>   public void testLogging() {
>     logger.severe("test - ERROR");
>     logger.warning("test - WARNING");
>     logger.info("test - INFO");
>     logger.fine("test - FINE");
>   }
> }
>
> with setLogging level I get Illegal argument exception, logger doesn't
> exist,
>
> I don't see my logger in jconsole either.
>
> Under java.util.logging -> loggerNames I see only:
>
>   sun.rmi.transport.tcp
>   sun.management
>   javax.management.timer
>   sun.rmi.client.ref
>   javax.management.mlet
> (...)
>

Management of loggers an exposing them via JMX is all done by JRE.
Tomcat has no say in that.

My guess would be that no instance of that logger class exists at that moment,
either because
a) An instance of LoggingTest class has not been created yet,
b) All instances of LoggingTest class have been garbage-collected.

All that depends on how you use your LoggingTest class.

This is just guess. The actual behaviour is provided by your JRE.

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

Reply via email to