Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pino-http-send

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-http-send

A basic handler for [pino](https://github.com/pinojs/pino) logs that sends batches to a desired endpoint via HTTP or HTTPS.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.1K
decreased by-2.07%
Maintainers
1
Weekly downloads
 
Created
Source

pino-http-send

A basic handler for pino logs that sends batches to a desired endpoint via HTTP or HTTPS.

npm Travis (.org) David

Pre v1 is subject to breaking changes on minor version change.

Installation

$ npm i pino-http-send

Usage

$ pino-http-send --help
pino-http-send [options]

Sending
  --method, -m
             [string] [choices: "POST", "PUT", "PATCH", "GET"] [default: "POST"]
  --bodyType, -b   type of body to send
                          [string] [choices: "json", "ndjson"] [default: "json"]
  --url            url to send logs to                       [string] [required]
  --batchSize, -s  how many logs to send at a time        [number] [default: 10]
  --timeout, -t    timeout (in ms) to send logs in bucket that are not filled
                                                        [number] [default: 5000]

Basic Auth
  --username, -u  basic auth username                                   [string]
  --password, -p  basic auth password                                   [string]

Retry
  --retries, -r   number of retries to do if failure       [number] [default: 5]
  --interval, -i  interval (in ms) to retry sending if failure
                                                        [number] [default: 1000]

Options:
  --help        Show help                                              [boolean]
  --version     Show version number                                    [boolean]
  --log, -l     log to console as well                [boolean] [default: false]
  --silent      silence pino-http-send logs for failures and retries
                                                      [boolean] [default: false]
  --config, -c  path to json config                                     [string]

Environment Variables

All options can be defined in the environment and are prefixed with PINO_HTTP_SEND_. All camel-cased options are parsed with delimiters of _.

e.g. The option batchSize as an env var would be PINO_HTTP_SEND_BATCH_SIZE.

URL

Example

$ node . | pino-http-send --url=http://localhost:8080

You can also do https...

$ node . | pino-http-send --url=https://myserver.com:8080

Body Type

  • ndjson - New-line delimited JSON. See ndjson
  • json - Standard JSON sending of data. Logs are sent in the format of
    {
      "logs": [...logs]
    }
    

Auth

Currently only basic auth is implemented. Tokens and other fun stuff will come later.

Keywords

FAQs

Package last updated on 08 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc