tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: application loggers not visible in jconsole
Date Mon, 03 Feb 2014 21:00:50 GMT
2014-01-31 Ja kub <jjakub83@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message