Class LogHeader


  • public class LogHeader
    extends Packet
    Represents the Log Header packet type which is used for storing and transferring log metadata.

    The LogHeader class is used to store and transfer log metadata. After the PipeProtocol or TcpProtocol has established a connection, a Log Header packet with the metadata of the current logging context is created and written. Log Header packets are used by the SmartInspect Router application for its filter and trigger functionality.

    This class is not guaranteed to be threadsafe. However, instances of this class will normally only be used in the context of a single thread.

    • Constructor Detail

      • LogHeader

        public LogHeader()
    • Method Detail

      • getSize

        public int getSize()
        Overridden. Returns the total occupied memory size of this Log Header packet. The total occupied memory size of this Log Header is the size of memory occupied by all strings and any internal data structures of this Log Header.
        Specified by:
        getSize in class Packet
        Returns:
        The total occupied memory size of this Log Header
      • getPacketType

        public PacketType getPacketType()
        Overridden. Returns PacketType.LogHeader.
        Specified by:
        getPacketType in class Packet
        Returns:
        Just PacketType.LogHeader. For a complete list of available packet types, please have a look at the documentation of the PacketType type
      • getContent

        public String getContent()
        Returns the entire content of this Log Header packet. The content of a Log Header packet is a key-value (syntax: key=value) list of the properties of this Log Header packet (currently only the getAppName and the getHostName strings). Key-value pairs are separated by carriage return and newline characters.
        Returns:
        The entire content of this Log Header packet
      • addValue

        public void addValue​(String key,
                             String value)
        Adds a key-value pair to this Log Header packet. If the key already exists, its value is overwritten with the provided value.
        Parameters:
        key - The key to be associated with the specified value
        value - The value to be associated with the specified key