@emartech/key-value-to-json-log

2.2.0 • Public • Published

@emartech/key-value-to-json-log

This tool is written to convert all logs generated by logentries-logformat in a process to be able to use and log with @emartech/json-logger.

Installation

npm install @emartech/key-value-to-json-log

or you can use it through npx

npx -p @emartech/key-value-to-json-log -c '<YOUR_PROCESS_TO_LOG> | key-value-to-json-log'

Usage

Command Line

Just pipe your process into the key-value-to-json-log bin.

node server/process/web | key-value-to-json-log

And now all incoming logs will be converted and output to process.stdout (or where @emartech/json-logger is logging).

Transformation rules

During the transformation the following rules are applied. Please refine your alerts!

Namespace/eventName

The namespace (type) will be logged as name, as the event's name (event) will be action.

The level of your log (previously result) is converted to a log level (level) by @emartech/json-logger. key-value-to-json-log uses the following mapping:

  • by default, everything is debug (20)
  • success will be info (30)
  • error will be error (50)

Timestamp

Even if the log message has a timestamp in it, it will be truncated and @emartech/json-logger will add its own time.

Key format

All log keys will be converted to snake_case.

Exception/Error

key-value-to-json-log detects if an Error had been logged and will transform the incoming name, message, code and stack keys by prefixing with error_ as it would be done by @emartech/json-logger if you would log an Error with logger.fromError().

Numbers

All incoming number values will be converted to float/int in the JSON output.

License

May be freely distributed under the MIT license.

Copyright (c) 2018 Emarsys Technologies Ltd. and other contributors

Readme

Keywords

none

Package Sidebar

Install

npm i @emartech/key-value-to-json-log

Weekly Downloads

39

Version

2.2.0

License

MIT

Unpacked Size

7.83 kB

Total Files

7

Last publish

Collaborators

  • mruell
  • akapa
  • mkls
  • kaaj
  • knagy
  • jfillmore
  • rehreth
  • pecc
  • mhegedus
  • norbert-levajsics-emarsys
  • mmartin
  • bsoos
  • emarsys-deployer
  • draven
  • drahos.istvan
  • judge
  • erikpetroemar
  • emarsys-security
  • daniel.banky
  • szeist
  • rgargya
  • marton.papp.emarsys
  • dgyenes
  • s.viktor
  • m4w4q7
  • david.barkoczi
  • adroszler
  • daniels1404
  • xin.he
  • qw3r
  • tamas.toth
  • gergaczd
  • viau
  • muddam
  • gerike
  • alkra
  • epgrubmair
  • bence.uto
  • cseby92
  • morban
  • ettancos
  • epmartini
  • gabor.balla.emarsys
  • mzsombor
  • ejpersson
  • ejwalker
  • llosonczy
  • iben12
  • kartonfarkas
  • adamoa
  • mbarna
  • peva
  • bforgacs
  • zsomborh
  • kozma
  • ngabor84
  • zerosuxx
  • andrasp3a
  • edosrecki
  • eadaniel
  • selator
  • fhase
  • kkimak
  • gaborb
  • glendvai
  • lveraszto
  • bozsadam
  • rdoczi
  • fentosi
  • boristomic
  • mbazso
  • dmihalek
  • lhalasz
  • evspasevski
  • jason-nelson-01
  • bence.toth
  • dsztanko
  • tbugar
  • fqqdk
  • menyhertfatyol
  • zoltanrideg-emarsys
  • sarakoll
  • mmolnar-emar
  • attila.gal
  • benjamingehl
  • rkumari03
  • tdorkaa
  • lkonya
  • dudaaslaci
  • gpap_ema
  • vimtaai
  • lloki-emarsys
  • mrmeszaros
  • borzi
  • varszegik
  • pmaksa_emarsys
  • i850773
  • dfarago
  • estefanlesnjakovic
  • attilamuller01
  • mhunyady
  • atittel
  • marton.matusek
  • sapfs
  • fenyopeti
  • sixstep
  • sap-jjf
  • saphendricksjoerg
  • pjohnson02
  • retfalvibence
  • brandon-sap
  • mmothersill
  • jerryrichardson
  • arnaud.buchholz
  • jamescocker
  • manasbommakanti
  • adamszabolcs
  • ushnpm
  • mengjiao.zhao
  • ianhelmrich
  • btalos
  • mmartin2
  • dkorpos
  • jbleclerc
  • nvkaur2
  • tbucsanszki
  • pendicg24
  • pintera
  • asciortino1
  • dmorvai
  • nicolaeciumac
  • dimitrovn
  • maurogreco
  • oliverweisenburger
  • bercziand
  • nish343
  • scotthetrick
  • konradschewe
  • ivanfroehlich
  • zbalazs
  • mattfeldhake_emarsys
  • ttoth2
  • bborsi
  • ziyadg
  • greszter
  • sovagos
  • apoon
  • burci
  • mark.adorjan
  • xueboliang
  • skrivoo
  • azorahai3904
  • kolosh
  • jviesersap
  • drewhodsonsap
  • criley
  • iulianmihai
  • mariannag
  • bobby_russel
  • dkocsis-emarsys
  • agrucza
  • marko.fritzsche
  • demajo_ems
  • tothmarci25
  • tsiraitnpm
  • plsap
  • sseidmed
  • roxanams
  • bencekadaremar
  • viktor.szell
  • dunaicapa
  • ccarrollem
  • geczirobert
  • sap-ns
  • balintkemenyemarsys
  • dhruv-sap
  • irvansap
  • markjarvis
  • rollandgh
  • laralangnau
  • tillmannr
  • eggarcia
  • rimo86
  • sevket-ataseven
  • zholler
  • robertoraczemarsys
  • samthomas02
  • mkrikoor
  • mfel0123
  • luca.fasolino.se
  • ndomke
  • franziskajung
  • andras.sarro
  • dschuppa
  • dszunomar
  • emarsys-stephen-ives
  • bencso
  • rcsullag
  • dputta
  • dwolter_emarsys
  • jisaacson
  • tothbence8
  • d056437
  • ekkovats
  • alanshi
  • earlpitts
  • probalazs
  • rmafteiuscai
  • lhammerl
  • iabraham
  • andras-marton-emarsys
  • nathan-matthews-sap
  • sfariel
  • schroedersteffen
  • botondjavorka
  • danielisap
  • gillyes
  • bronika
  • tade82
  • dpkemarsys
  • karlabrandl
  • mlesh-sap
  • tonyhsap
  • aidanlesh-sap
  • nikolett.tar
  • sridevir
  • cenglersap
  • birokhun
  • abieler-sap
  • i534456
  • daniel.balazs
  • laszlo.ori
  • troywiegand
  • bcsizmadia
  • ariceem
  • csjakabos
  • borcsa
  • nnieman-sap
  • sap-am
  • vszegedi
  • ronnykrosse
  • taylor-seth
  • mrclsu
  • fcolombo-sap
  • mfawal
  • szb
  • ahorvath1991
  • torokhelen
  • matusekma