private void createEventOTag ( StringBuilder sb , RepositoryLogRecord record , Locale locale ) { sb . append ( "<CommonBaseEvent creationTime=\"" ) ; // create the XML dateTime format // TimeZone is UTC, but since we are dealing with Millis we are already in UTC. sb . append ( CBE_DATE_FORMAT . format ( record . getMillis ( ) ) ) ; sb . append ( "\"" ) ; // create and add the globalInstanceId sb . append ( " globalInstanceId=\"" ) . append ( GUID_PREFIX ) . append ( Guid . generate ( ) ) . append ( "\"" ) ; // write out the msg sb . append ( " msg=\"" ) . append ( formatMessage ( record , locale ) ) . append ( "\"" ) ; short severity = 0 ; if ( record . getLevel ( ) . intValue ( ) >= Level . SEVERE . intValue ( ) ) { severity = 50 ; } else if ( record . getLevel ( ) . intValue ( ) >= Level . WARNING . intValue ( ) ) { severity = 30 ; } else { severity = 10 ; } sb . append ( " severity=\"" ) . append ( severity ) . append ( "\"" ) ; sb . append ( " version=\"1.0.1\">" ) ; }
Appends the opening tag of a CommonBaseEvent XML element to a string buffer