Class EssLogEntry

java.lang.Object
com.appliedolap.essbase.EssLogEntry

public final class EssLogEntry extends Object
One line of an Essbase log, read apart into its fields.

Essbase writes ODL (Oracle Diagnostic Logging), which is a timestamp and a run of bracketed fields followed by the message:

 [2026-09-10T20:57:04.112+00:00] [Sample] [ERROR:32] [OTLAPI-54] [OTLAPI] [ecid: 178...,0]
     [tid: 140680831694400] [REQ_ID: 6aa3199e00000021] [DBNAME: Basic] Cannot find generation...
 

The first five brackets are positional - timestamp, application, severity, message id, component. The ones after them are named, name: value, and which of them appear varies by the kind of event: a request carries REQ_ID and DBNAME, a startup message carries neither. They are kept in getFields() rather than modelled, for the same reason a member's outline row is.

A line that doesn't parse is not discarded. It comes back with its text in getMessage() and everything else null, because a log you can only read the well-formed half of is worse than no parsing at all.

  • Method Details

    • getTimestamp

      public Instant getTimestamp()
      When the event happened, or null for a line that didn't parse.
    • getApplication

      public String getApplication()
      The application the event belongs to, or null on a server-level line.
    • getSeverity

      public EssLogEntry.Severity getSeverity()
    • getSeverityLevel

      public int getSeverityLevel()
      The numeric grade beside the severity - the 32 of ERROR:32 - or -1 if there wasn't one.
    • getMessageId

      public String getMessageId()
      The catalogue number, e.g. OTLAPI-54, which is what you search Oracle's messages for.
    • getComponent

      public String getComponent()
      The subsystem that logged it, e.g. OTLAPI, REQ, TCP.
    • getFields

      public Map<String,String> getFields()
      The named brackets after the positional ones - ecid, tid, REQ_ID, DBNAME - keyed as the log spells them.
    • getMessage

      public String getMessage()
      The message text, and for an unparseable line the whole of it.
    • getRaw

      public String getRaw()
      The line exactly as it was read.
    • isParsed

      public boolean isParsed()
      Whether the line was understood. A false here still leaves getMessage() usable.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parseAll

      public static List<EssLogEntry> parseAll(InputStream stream) throws IOException
      Reads a whole log.

      Handles the byte-order mark Essbase writes at the head of the file, and folds a line that doesn't begin a new entry into the one before it - a message can contain newlines, and a stack trace split across entries is unreadable.

      Parameters:
      stream - the log, which is closed by this method
      Returns:
      the entries, oldest first
      Throws:
      IOException - if the log can't be read
    • parse

      public static EssLogEntry parse(String line)
      Reads one entry. Never throws and never returns null: a line it can't read comes back with isParsed() false and the text intact.
      Parameters:
      line - the line, which may carry folded continuation lines
      Returns:
      the entry