private WsLogRecord createWsLogRecord ( Level level , String msg , Object [ ] params , String sourceClassName , String sourceMethodName , String resourceBundleName , ResourceBundle resourceBundle , Throwable thrown ) { WsLogRecord logRecord = new WsLogRecord ( level , msg ) ; if ( params != null ) { logRecord . setParameters ( params ) ; // special handling for byte arrays in the first param position if ( ( params . length > 0 && params [ 0 ] != null ) && byte . class . equals ( params [ 0 ] . getClass ( ) . getComponentType ( ) ) ) logRecord . setRawData ( ( byte [ ] ) params [ 0 ] ) ; } if ( sourceClassName != null ) { logRecord . setSourceClassName ( sourceClassName ) ; } if ( sourceMethodName != null ) { logRecord . setSourceMethodName ( sourceMethodName ) ; } if ( resourceBundleName != null ) { logRecord . setResourceBundleName ( resourceBundleName ) ; } if ( resourceBundle != null ) { logRecord . setResourceBundle ( resourceBundle ) ; } if ( thrown != null ) { logRecord . setThrown ( thrown ) ; } if ( getName ( ) != null ) { logRecord . setLoggerName ( getName ( ) ) ; } if ( getOrganization ( ) != null ) { logRecord . setOrganization ( getOrganization ( ) ) ; } if ( getProduct ( ) != null ) { logRecord . setProduct ( getProduct ( ) ) ; } if ( getComponent ( ) != null ) { logRecord . setComponent ( getComponent ( ) ) ; } LogRecordContext . getExtensions ( logRecord . getExtensions ( ) ) ; logRecord . setTraceClass ( ivTC . getTraceClass ( ) ) ; // populate runtime data // Note: this is WAS version, UOW, process ID, etc // WsLoggerRuntimeData.getInstance().populate(logRecord); return logRecord ; }
Construct a WsLogRecord with the given level and message values .