edgeport - v1.0.3
    Preparing search index...

    Function connect

    • Opens a syslog session over TCP.

      Connects to the collector (plaintext by default, implicit TLS, or a STARTTLS upgrade), applies the framing and per-message defaults, and returns a reusable SyslogSession. Remember to SyslogSession.close (or use await using) to release the socket.

      Parameters

      Returns Promise<SyslogSession>

      A ready session.

      If the socket cannot be opened.

      If a default facility or severity is later found invalid.

      1.0.0

      import { connect, Severity } from 'edgeport/syslog';

      const session = await connect({ hostname: 'logs.example.com', appName: 'api' });
      try {
      await session.log({
      severity: Severity.warning,
      message: 'disk almost full',
      structuredData: [{ id: 'meta@1', params: { pct: '92' } }]
      });
      } finally {
      await session.close();
      }