logpost

0.1.2 • Public • Published

LogPost

Logging middleware in Hono

Support Providers

  • console.log()
  • New Relic (docs)
  • Datadog (docs)

Usage

See example.js

  • Console (console.log())

    import { logpost } from './logpost.js'
    app.use('*', logpost())
  • New Relic

    import { logpost } from './logpost.js'
    app.use('*',
      logpost({
        type: 'newrelic',
        newrelic: {
          region: 'us',
          key: '<API Key (INGEST - LICENSE)>',
          // "req" is "c.raw.req"
          body: async (req) => {
            return {
              timestamp: Date.now(),
              path: req.url.pathname,
            }
          }
        }
      })
    )

Author

Shinosaki

LICENSE

MIT

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i logpost

      Weekly Downloads

      1

      Version

      0.1.2

      License

      MIT

      Unpacked Size

      14.9 kB

      Total Files

      13

      Last publish

      Collaborators

      • shinosaki