Socket
Socket
Sign inDemoInstall

@elastic/ecs-morgan-format

Package Overview
Dependencies
10
Maintainers
62
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @elastic/ecs-morgan-format

A formatter for the morgan logger compatible with Elastic Common Schema.


Version published
Maintainers
62
Install size
1.79 MB
Created

Readme

Source

@elastic/ecs-morgan-format

Build Status js-standard-style

A formatter for the morgan logger compatible with Elastic Common Schema.
In combination with filebeat you can send your logs directly to Elasticsearch and leverage Kibana's Logs UI to inspect all logs in one single place.

Install

npm i @elastic/ecs-morgan-format

Usage

const app = require('express')()
const morgan = require('morgan')
const ecsFormat = require('@elastic/ecs-morgan-format')()

app.use(morgan(ecsFormat))

app.get('/', function (req, res) {
  res.send('hello, world!')
})

app.listen(3000, () => {
  console.log('Listening')
})

Options

You can pass any format option you would normally pass to morgan, and the log message will use the specified format (the default is combined).

const app = require('express')()
const morgan = require('morgan')
const ecsFormat = require('@elastic/ecs-morgan-format')('tiny')
app.use(morgan(ecsFormat))

License

This software is licensed under the Apache 2 license.

Keywords

FAQs

Last updated on 16 Mar 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc