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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i logpost

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

14.9 kB

Total Files

13

Last publish

Collaborators

  • shinosaki