public static String currentConfiguration ( ) { StringBuffer rtn = new StringBuffer ( 1024 ) ; String loggingConfigClass = System . getProperty ( "java.util.logging.config.class" ) ; String loggingConfigFile = System . getProperty ( "java.util.logging.config.file" ) ; boolean configClassOK = false ; if ( loggingConfigClass == null ) { rtn . append ( "No java.util.logging.config.class class is set.\n" ) ; } else { rtn . append ( "java.util.logging.config.class is set to '" ) . append ( loggingConfigClass ) . append ( "'\n" ) ; try { Class c = Class . forName ( loggingConfigClass ) ; c . newInstance ( ) ; rtn . append ( "This class was loaded and a new instance was sucessfully created.\n" ) ; configClassOK = true ; } catch ( ClassNotFoundException e ) { e = null ; rtn . append ( loggingConfigClass ) . append ( " could not be found." ) ; } catch ( InstantiationException e ) { e = null ; rtn . append ( loggingConfigClass ) . append ( " could not be instantiated." ) ; } catch ( IllegalAccessException e ) { e = null ; rtn . append ( loggingConfigClass ) . append ( " could not be accessed." ) ; } } if ( loggingConfigFile == null ) { rtn . append ( "No java.util.logging.config.file file is set.\n" ) ; } else { rtn . append ( "java.util.logging.config.file is set to '" ) . append ( loggingConfigFile ) . append ( "'\n" ) ; File loggingFile = new File ( loggingConfigFile ) ; rtn . append ( loggingFile . getAbsolutePath ( ) ) . append ( "\n" ) ; if ( ! loggingFile . exists ( ) || ! loggingFile . isFile ( ) ) { rtn . append ( "This file does NOT EXIST.\n" ) ; } if ( loggingConfigClass != null ) { if ( configClassOK ) { rtn . append ( "This file is ignored because java.util.logging.config.class is set.\n" ) ; } } } Handler [ ] handlers = Logger . getLogger ( "" ) . getHandlers ( ) ; listHandlers ( handlers , rtn ) ; return rtn . toString ( ) ; }
Provides a string containing information about the configured logging set up .