private void privateReconfigureLogging ( String pkg , final String name ) { LogManager logManager = LogManager . getLogManager ( ) ; Logger logger = Logger . getLogger ( LoggingConfiguration . class . getName ( ) ) ; // allow null as package name. if ( pkg == null ) { pkg = "" ; } // Load logging configuration from current directory String cfgfile = name ; if ( new File ( name ) . exists ( ) ) { cfgfile = name ; } else { // Fall back to full path / resources. cfgfile = pkg . replace ( ' ' , File . separatorChar ) + File . separatorChar + name ; } try { InputStream cfgdata = openSystemFile ( cfgfile ) ; logManager . readConfiguration ( cfgdata ) ; // also load as properties for us, to get debug flag. InputStream cfgdata2 = openSystemFile ( cfgfile ) ; Properties cfgprop = new Properties ( ) ; cfgprop . load ( cfgdata2 ) ; DEBUG = Boolean . parseBoolean ( cfgprop . getProperty ( "debug" ) ) ; logger . info ( "Logging configuration read." ) ; } catch ( FileNotFoundException e ) { logger . log ( Level . SEVERE , "Could not find logging configuration file: " + cfgfile , e ) ; } catch ( Exception e ) { logger . log ( Level . SEVERE , "Failed to configure logging from file: " + cfgfile , e ) ; } }
Reconfigure logging .