@elastic/ecs-pino-format
    TypeScript icon, indicating that this package has built-in type declarations

    1.3.0 • Public • Published

    @elastic/ecs-pino-format

    Build Status js-standard-style

    This Node.js package provides a formatter for the pino logger compatible with Elastic Common Schema (ECS) logging.
    In combination with the filebeat shipper, you can send your logs directly to Elasticsearch and leverage Kibana's Logs app to inspect all logs in one single place.

    Please see the Node.js ECS pino documentation.

    Install

    npm install @elastic/ecs-pino-format

    Usage

    This package will configure Pino's formatters, messageKey and timestamp options.

    const ecsFormat = require('@elastic/ecs-pino-format')
    const pino = require('pino')
    
    const log = pino(ecsFormat())
    log.info('Hello world')
    
    const child = log.child({ module: 'foo' })
    child.warn('From child')

    Running this will produce log output similar to the following:

    {"log.level":"info","@timestamp":"2021-01-19T22:51:12.142Z","ecs":{"version":"1.6.0"},"process":{"pid":82240},"host":{"hostname":"pink.local"},"message":"Hello world"}
    {"log.level":"warn","@timestamp":"2021-01-19T22:51:12.143Z","ecs":{"version":"1.6.0"},"process":{"pid":82240},"host":{"hostname":"pink.local"},"module":"foo","message":"From child"}

    Please see the Node.js ECS pino documentation for more.

    License

    This software is licensed under the Apache 2 license.

    Install

    npm i @elastic/ecs-pino-format

    DownloadsWeekly Downloads

    137,566

    Version

    1.3.0

    License

    Apache-2.0

    Unpacked Size

    30.6 kB

    Total Files

    7

    Last publish

    Collaborators

    • brianvans
    • breehall
    • trevorpierce
    • glitteringkatie
    • chandlerprall
    • snide
    • chrisronline
    • cchaos
    • jen-huang
    • spalger
    • delvedor
    • courtewing
    • lukasolson
    • ccowan
    • cjcenizal
    • jbudz
    • tylersmalley
    • thomasneirynck
    • weltenwort
    • timroes
    • pugnascotia
    • zinckiwi
    • brandon.kobel
    • nreese
    • elasticdog
    • mgreau
    • fatmcgav
    • mindbat
    • itsmed
    • tylerjl
    • chris.koehnke.at.elastic
    • jonahbull
    • jarpy
    • leathekd
    • drewr
    • nyurik
    • crazybus
    • lukeelmers
    • ddillinger
    • joshdover
    • jasonstoltz
    • bamieh
    • markov00
    • thompsongl
    • ryan.haywood
    • olksdr
    • fxdgear
    • joshmock
    • vignesh.shanmugam
    • watson
    • rhodesjason
    • nik9000
    • jmlrt
    • eliperelman
    • mattkime
    • constancecchen
    • yakhinvadim
    • afoucret
    • nickpeihl
    • axw
    • mistic
    • elasticmachine
    • gtback
    • johannes.reuter.elastic
    • pickypg
    • gmmorris
    • richard.kuzsma
    • alanstorm
    • trentm
    • andrewvc-elastic
    • jorge.sanz
    • stratoula
    • nkammah
    • streamich
    • nickofthyme
    • chloeruka