public static synchronized void configure() { configure(false); }
public static synchronized void configure(final boolean reset) { if(reset){ logStreamFactory = null; } configure(System.getProperties()); }
/** * Finds a Logger from the cache and returns it. If not found in cache then builds a Logger and returns it. * * @param category - The category of the logger * @param baseName - The baseName for the ResourceBundle * @return Logger */ public static Logger getInstance(final LogCategory category, final String baseName) { configure(); try { return loggerCache.compute(new Object[]{category, baseName}); } catch (final InterruptedException e) { // Don't return null here. Just create a new Logger and set it up. // It will not be stored in the cache, but a later lookup for the // same Logger would probably end up in the cache final LogStream logStream = logStreamFactory.createLogStream(category); return new Logger(category, logStream, baseName); } }
public static synchronized void configure() { configure(SystemInstance.isInitialized() ? SystemInstance.get().getProperties() : JavaSecurityManagers.getSystemProperties()); }
/** * Finds a Logger from the cache and returns it. If not found in cache then builds a Logger and returns it. * * @param category - The category of the logger * @param baseName - The baseName for the ResourceBundle * @return Logger */ public static Logger getInstance(final LogCategory category, final String baseName) { configure(); try { return loggerCache.compute(new LoggerKey(category, baseName)); } catch (final InterruptedException e) { // Don't return null here. Just create a new Logger and set it up. // It will not be stored in the cache, but a later lookup for the // same Logger would probably end up in the cache final LogStream logStream = logStreamFactory.createLogStream(category); return new Logger(category, logStream, baseName); } }
Logger.configure(true);
Logger.configure(); Logger logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, "org.apache.openejb.util.resources");