@awesomeorganization/syslog

[ESM] The syslog protocol (rfc5424) client. Works with Node.js over udp (rfc5426), tcp (rfc6587) and tls (rfc5425)

Usage no npm install needed!

<script type="module">
  import awesomeorganizationSyslog from 'https://cdn.skypack.dev/@awesomeorganization/syslog';
</script>

README

syslog

:boom: [ESM] The syslog protocol (rfc5424) client. Works with Node.js over udp (rfc5426), tcp (rfc6587) and tls (rfc5425)


npm npm npm npm npm npm


Example

Full example in /example folder.

import { syslog } from '@awesomeorganization/syslog'

const example = async () => {
  {
    const log = syslog({
      defaultStructuredData: {
        '8bf8cc10-4140-4c3e-a2b4-e6f5324f1aea@41058': {
          tag: 'tcp',
        },
      },
      host: 'logs-01.loggly.com',
      port: 514,
      protocol: 'tcp',
    })

    await log({
      message: 'Works with tcp!',
    })
  }
  {
    const log = syslog({
      defaultStructuredData: {
        '8bf8cc10-4140-4c3e-a2b4-e6f5324f1aea@41058': {
          tag: 'tls',
        },
      },
      host: 'logs-01.loggly.com',
      port: 6514,
      protocol: 'tls',
    })

    await log({
      message: 'Works with tls!',
    })
  }
}

example()