Connection and default-field options.
A ready session.
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();
}
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.