Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks to Mark's comment above I managed to solve my problem by configuring java.util.logging to redirect to slf4j. This is not an elegant solution but for the purposes I need, it suffices:</p> <pre><code>private static void configureJavaUtilLogging() { final java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger(""); for (final java.util.logging.Handler handler : rootLogger.getHandlers()) { handler.setLevel(Level.OFF); } rootLogger.setLevel(Level.INFO); rootLogger.addHandler(new java.util.logging.Handler() { @Override public void publish(final LogRecord record) { final Logger log = LoggerFactory.getLogger(record.getSourceClassName()); if (record.getLevel() == Level.SEVERE) { if (record.getThrown() == null) { log.error(record.getMessage()); } else { log.error(record.getMessage(), record.getThrown()); } } else if (record.getLevel() == Level.WARNING) { log.warn(record.getMessage()); } else if (record.getLevel() == Level.INFO) { log.info(record.getMessage()); } else { log.debug(record.getMessage()); } } @Override public void flush() { } @Override public void close() throws SecurityException { } }); } </code></pre> <p>With this I can configure log output for everyone in my one configuration. Basically the code above overwrites the default configuration for java.util.logging that is stored somewhere within the jdk or jre. </p> <p>I am not sure what to do with the <code>flush</code> and <code>close</code> methods. Before using this kind of stuff ina production environment those would need to be checked out. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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