edgeport - v1.0.3
    Preparing search index...

    Interface SyslogSession

    A live syslog session that can send one or more records.

    Obtain one with connect. It is an AsyncDisposable, so it can be scoped with await using and closes the socket on disposal. Because syslog over TCP is one-way, no method ever reads a reply.

    1.0.0

    import { connect } from 'edgeport/syslog';

    await using session = await connect({ hostname: 'logs.example.com', appName: 'api' });
    await session.log({ severity: 'info', message: 'service started' });
    interface SyslogSession {
        "[asyncDispose]"(): PromiseLike<void>;
        close(): Promise<void>;
        debug(
            message: string,
            opts?: Omit<LogOptions, "message" | "severity">,
        ): Promise<void>;
        emit(rawLine: string): Promise<void>;
        error(
            message: string,
            opts?: Omit<LogOptions, "message" | "severity">,
        ): Promise<void>;
        info(
            message: string,
            opts?: Omit<LogOptions, "message" | "severity">,
        ): Promise<void>;
        log(opts: LogOptions): Promise<void>;
        notice(
            message: string,
            opts?: Omit<LogOptions, "message" | "severity">,
        ): Promise<void>;
        warn(
            message: string,
            opts?: Omit<LogOptions, "message" | "severity">,
        ): Promise<void>;
    }

    Hierarchy

    • AsyncDisposable
      • SyslogSession
    Index
    • Returns PromiseLike<void>

    • Logs a message at Severity.debug.

      A shortcut for log with severity: 'debug'.

      Parameters

      • message: string

        The free-form message text.

      • Optionalopts: Omit<LogOptions, "message" | "severity">

        Optional other fields, identical to LogOptions minus severity and message.

      Returns Promise<void>

      Resolves once the bytes are written.

      If the message cannot be formatted.

      If the write fails.

      1.0.2

    • Frames and sends an already-formatted line verbatim.

      Parameters

      • rawLine: string

        A complete syslog message; it is framed but not otherwise altered.

      Returns Promise<void>

      Resolves once the bytes are written.

    • Logs a message at Severity.error.

      A shortcut for log with severity: 'error'.

      Parameters

      • message: string

        The free-form message text.

      • Optionalopts: Omit<LogOptions, "message" | "severity">

        Optional other fields, identical to LogOptions minus severity and message.

      Returns Promise<void>

      Resolves once the bytes are written.

      If the message cannot be formatted.

      If the write fails.

      1.0.2

    • Logs a message at Severity.info.

      A shortcut for log with severity: 'info'. Any other field (facility, structured data, overrides) can be passed in opts.

      Parameters

      • message: string

        The free-form message text.

      • Optionalopts: Omit<LogOptions, "message" | "severity">

        Optional other fields, identical to LogOptions minus severity and message.

      Returns Promise<void>

      Resolves once the bytes are written.

      If the message cannot be formatted.

      If the write fails.

      1.0.2

    • Formats a record as an RFC 5424 line, frames it, and writes it.

      Parameters

      Returns Promise<void>

      Resolves once the bytes are written to the transport.

      If the message cannot be formatted.

      If the write fails.

    • Logs a message at Severity.notice.

      A shortcut for log with severity: 'notice'.

      Parameters

      • message: string

        The free-form message text.

      • Optionalopts: Omit<LogOptions, "message" | "severity">

        Optional other fields, identical to LogOptions minus severity and message.

      Returns Promise<void>

      Resolves once the bytes are written.

      If the message cannot be formatted.

      If the write fails.

      1.0.2

    • Logs a message at Severity.warning.

      A shortcut for log with severity: 'warning'.

      Parameters

      • message: string

        The free-form message text.

      • Optionalopts: Omit<LogOptions, "message" | "severity">

        Optional other fields, identical to LogOptions minus severity and message.

      Returns Promise<void>

      Resolves once the bytes are written.

      If the message cannot be formatted.

      If the write fails.

      1.0.2