static String getLogHeader ( Map < String , String > config ) { StringBuilder builder = new StringBuilder ( 512 ) ; String productInfo = config . get ( "websphere.product.info" ) ; if ( productInfo != null ) { builder . append ( "product = " ) . append ( productInfo ) . append ( LoggingConstants . nl ) ; } String installDir = config . get ( "wlp.install.dir" ) ; if ( installDir != null ) { builder . append ( "wlp.install.dir = " ) . append ( installDir ) . append ( LoggingConstants . nl ) ; } String serverConfigDir = config . get ( "server.config.dir" ) ; if ( serverConfigDir != null && ! "true" . equals ( config . get ( "wlp.user.dir.isDefault" ) ) ) { builder . append ( "server.config.dir = " ) . append ( serverConfigDir ) . append ( LoggingConstants . nl ) ; } String serverOutputDir = config . get ( "server.output.dir" ) ; if ( serverOutputDir != null && ! serverOutputDir . equals ( serverConfigDir ) ) { builder . append ( "server.output.dir = " ) . append ( serverOutputDir ) . append ( LoggingConstants . nl ) ; } builder . append ( "java.home = " ) . append ( System . getProperty ( "java.home" ) ) . append ( LoggingConstants . nl ) ; builder . append ( "java.version = " ) . append ( System . getProperty ( "java.version" ) ) . append ( LoggingConstants . nl ) ; builder . append ( "java.runtime = " ) . append ( System . getProperty ( "java.runtime.name" ) ) . append ( " (" ) . append ( System . getProperty ( "java.runtime.version" ) ) . append ( ' ' ) . append ( LoggingConstants . nl ) ; builder . append ( "os = " ) . append ( System . getProperty ( "os.name" ) ) . append ( " (" ) . append ( System . getProperty ( "os.version" ) ) . append ( "; " ) . append ( System . getProperty ( "os.arch" ) ) . append ( ") (" ) . append ( Locale . getDefault ( ) ) . append ( ")" ) . append ( LoggingConstants . nl ) ; // avoid the initialization overhead retrieving the RuntimeMXBean. Not guaranteed to work on all platforms, so fallback as appropriate builder . append ( "process = " ) ; String pid = System . getProperty ( "sun.java.launcher.pid" ) ; if ( pid != null ) { try { String ip = InetAddress . getLocalHost ( ) . getHostAddress ( ) ; builder . append ( pid ) . append ( ' ' ) . append ( ip ) ; } catch ( Exception e ) { pid = null ; } } if ( pid == null ) { builder . append ( ManagementFactory . getRuntimeMXBean ( ) . getName ( ) ) ; } builder . append ( LoggingConstants . nl ) ; return builder . toString ( ) ; }
Returns the header to be written at the beginning of all log files .