Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
  app
  Jenkinsfile
  package.json
  README.md
Size: Mime:
  README.md

dlog

A small utility tool to parse and print our JSON logs into a more human readable format. Works with spring-boot microservices in Doodle ecosystem.

Installation

  1. Make sure you have the latest version of node installed and you have at least read access to Doodle's NPM repository. The instructions are here.
  2. Install the tool globally: npm i -g @doodle/dlog

Usage

The tool consumers JSON from the instandard input, formats it and prints the message in the standard output. So all you need to do is to pipe the output from k logs to dlog:

$ k logs -f <POD_NAME> | dlog

You cann simplify things by adding an alias in your bash, for example, for ZSH, you need to add the following lines to your .zshrc file:

k_dlogs() {
  k logs -f $1 | dlog
}

alias kdlog="k_dlogs"

Don't forget to source ~/.zshrc after editing it.

Then you can call if from anywhere: kdlog <POD_NAME>. For example: kdlog svc-user-segmentation-0.

Together with stern

With stern you can use this tool easily by writting simple commands like:

stern webhook | dlog

and you will get output like: image

Options

In case you need to watch the logs in real time and you are interested in a log level different from the configurared in the app, you can override it by setting the DOODLE_DLOG_LOG_LEVEL environment variable.

For example, if you set DOODLE_DLOG_LOG_LEVEL to warn, only warnings and errors will be displayed for you. This helps in real time debugging.