Class HpelCBEFormatter
- java.lang.Object
-
- com.ibm.websphere.logging.hpel.reader.HpelFormatter
-
- com.ibm.websphere.logging.hpel.reader.HpelCBEFormatter
-
public class HpelCBEFormatter extends HpelFormatter
A HpelFormatter subclass implementation that provides formatting of RepositoryLogRecord to a CBE format.
-
-
Field Summary
-
Fields inherited from class com.ibm.websphere.logging.hpel.reader.HpelFormatter
FORMAT_ADVANCED, FORMAT_BASIC, FORMAT_CBE101, FORMAT_JSON
-
-
Constructor Summary
Constructors Constructor Description HpelCBEFormatter()
Creates a HpelCBEFormatter instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
formatRecord(RepositoryLogRecord record, java.util.Locale locale)
Formats a RepositoryLogRecord into a localized CBE format output String.java.lang.String
getFooter()
Gets the formatter's footer.java.lang.String
getFormattedRecord(RepositoryLogRecord record, java.util.Locale locale)
Gets a String representation of a log record as a CBEEvent XML elementjava.lang.String[]
getHeader()
Gets the formatter's header.-
Methods inherited from class com.ibm.websphere.logging.hpel.reader.HpelFormatter
addCustomLevel, addCustomLevel, convertParameters, formatMessage, formatRecord, formatRecord, getFormatter, getHeaderProps, getLineSeparator, getLocale, getTimeZoneID, setCustomHeader, setDateFormat, setHeaderProps, setLineSeparator, setStartDatetime, setTimeZoneID, translateMessage
-
-
-
-
Method Detail
-
formatRecord
public java.lang.String formatRecord(RepositoryLogRecord record, java.util.Locale locale)
Formats a RepositoryLogRecord into a localized CBE format output String.- Specified by:
formatRecord
in classHpelFormatter
- Parameters:
record
- the RepositoryLogRecord to be formattedlocale
- the Locale to use for localization when formatting this record.- Returns:
- the formated string output.
-
getFooter
public java.lang.String getFooter()
Description copied from class:HpelFormatter
Gets the formatter's footer. This method will return an empty string if the formatter does not have a footer as part of the formatter's format style.- Specified by:
getFooter
in classHpelFormatter
- Returns:
- the footer as a string
-
getHeader
public java.lang.String[] getHeader()
Description copied from class:HpelFormatter
Gets the formatter's header. This method will return an empty array if the formatter does not have a header as part of the formatter's format style return the header as an array of strings- Specified by:
getHeader
in classHpelFormatter
-
getFormattedRecord
public java.lang.String getFormattedRecord(RepositoryLogRecord record, java.util.Locale locale)
Gets a String representation of a log record as a CBEEvent XML element- Parameters:
record
- of the event.locale
- the locale to use when printing the output.- Returns:
- String representation of the record in CBE format.
-
-