0.1.2 • Published 4 months ago

logpost v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago