CLI

July 28, 2020 ยท View on GitHub

To use pino-datadog from the command line, you need to install it globally:

npm install -g pino-datadog

Example

Given an application foo that logs via pino, you would use pino-datadog like so:

node foo | pino-datadog --key blablabla

Usage

You can pass the following options via cli arguments or use the environment variable associated:

Short commandFull commandEnvironment variableDescription
-V--versionOutput the version number
-k--key <apikey>DD_API_KEYThe API key that can be found in your DataDog account
-d--ddsource <source>DD_SOURCEDefault source for the logs
-t--ddtags <tags>DD_TAGSDefault list of tags for the logs
-s, --service <service>DD_SERVICEDefault service for the logs
--hostname <hostname>DD_HOSTNAMEDefault hostname for the logs
-e--euDD_EUUse Datadog EU site
-b--batch <size>The number of log messages to send as a single batch (defaults to 1)
-h--helpOutput usage information
--no-stdoutDisable output to stdout

See the API documentation for details.