Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use a <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/logging/Handler.html" rel="nofollow">Handler</a> subclass to process the data being logged.</p> <p>Then you can add it to your root logger via your config file or programmaticaly via the <code>addHandler</code> method of Logger class.</p> <p>For example you can create a Handler subclass FoobarHandler that print all logged data on the console prefixed with a "Foobar " text:</p> <pre><code>public class MyHandler extends Handler { @Override public void close() throws SecurityException { // housekeeping before handler close } @Override public void flush() { // not really needed as data is processed without any sort of buffering } @Override public void publish(LogRecord record) { System.out.println("Foobar " + record.getMessage().toUpperCase()); } } </code></pre> <p>In your config file you add the class name (i.e. <code>myapp.FoobarHandler</code>) of your Handler to the global handlers config:</p> <pre><code># Global logging properties. # ------------------------------------------ # The set of handlers to be loaded upon startup. # Comma-separated list of class names. # (? LogManager docs say no comma here, but JDK example has comma.) handlers=java.util.logging.FileHandler, myapp.FoobarHandler # Default global logging level. # Loggers and Handlers may override this level .level=INFO # Loggers # ------------------------------------------ # Loggers are usually attached to packages. # Here, the level for each package is specified. # The global level is used by default, so levels # specified here simply act as an override. myapp.ui.level=ALL myapp.business.level=CONFIG myapp.data.level=SEVERE </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload