Skip to content

Latest commit

History

History
33 lines (24 loc) 路 1.52 KB

CLI.md

File metadata and controls

33 lines (24 loc) 路 1.52 KB

CLI

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

npm install -g pino-stackdriver

Example

Given an application foo that logs via pino, a stackdriver log project bar and credentials in the file /credentials.json, you would use pino-stackdriver like so:

node foo | pino-stackdriver --project bar --credentials /credentials.json

Usage

You can pass the following options via cli arguments:

Short command Full command Description
-V --version Output the version number
-p --project <project> Your Google Cloud Platform project ID (or use env var PROJECT_ID)
-c --credentials <credentials> The file path of the JSON file that contains your service account key (or use env var GOOGLE_APPLICATION_CREDENTIALS). you can also use clientEmail and privateKey instead of the path.
-e --clientEmail <email> Client email, part of credentials object provided by Google
-g --privateKey <googleKey> Private key, part of credentials object provided by Google.
-k --key <key:customKey> Repeatable key:customKey pairs for custom keys (see API docs)
-n --logName The resource to send logs to. Defaults to {"type": "global"}.
-r --resource <resourcejson> Resource to send the logs to, input in JSON (see API docs)
-h --help Output usage information

See the API documentation for details.