Java Logging:logmanager

Source: Internet
Author: User

java.util.logging.LogManagerthe manages the internal Logger hierarchy, and initiates Logger the configuration of the ' s, either through the Configu Ration class or configuration file.

There is a single instantiated in the LogManager whole JVM. It's a singleton, in the other words. Here's how to obtain the LogManager instance:

Logmanager manager = Logmanager.getlogmanager ();

  

You won't often need to interact directly LogManager with the, except for a few borderline cases.

For instance, if you want-reload the configuration file, you can do so using either of these methods:

Readconfiguration (); readconfiguration (InputStream);

  

The first method on LogManager the simply re-reads the configuration from file (or Class), in case these have changed.

The second method on the LogManager simply reads the configuration from the given InputStream .

You can also get access to a MXBean (Java Management Extensions) from the LogManager using the method getLoggingMXBean() . Here are an example:

Loggingmxbean MxBean = Logmanager.getloggingmxbean ();

  

The have more LogManager methods than these and the most often you'll not need them. Check the official JavaDoc For more information, if you need to do something not covered here.



Java Logging:logmanager

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.