[Very low overhead](#low-overhead) JavaScript logger.


## Runtimes

### Node.js

Pino is built to run on [Node.js](http://nodejs.org).

### Bare

Pino works on [Bare](https://github.com/holepunchto/bare) with the [`pino-bare`](https://github.com/pinojs/pino-bare) compatibility module.

### Pear

Pino works on [Pear](https://docs.pears.com), which is built on [Bare](https://github.com/holepunchto/bare), with the [`pino-bare`](https://github.com/pinojs/pino-bare) compatibility module.


## Install

Using NPM:
```
$ npm install pino
```

Using YARN:
```
$ yarn add pino
```

If you would like to install pino v6, refer to https://github.com/pinojs/pino/tree/v6.x.

## Usage

```js
const logger = require('pino')()

logger.info('hello world')

const child = logger.child({ a: 'property' })
child.info('hello child!')
```

This produces:

```
{"level":30,"time":1531171074631,"msg":"hello world","pid":657,"hostname":"Davids-MBP-3.fritz.box"}
{"level":30,"time":1531171082399,"msg":"hello child!","pid":657,"hostname":"Davids-MBP-3.fritz.box","a":"property"}
```

For using Pino with a web framework see:

* [Pino with Fastify](/docs/latest/web/#fastify)
* [Pino with Express](/docs/latest/web/#express)
* [Pino with Hapi](/docs/latest/web/#hapi)
* [Pino with Restify](/docs/latest/web/#restify)
* [Pino with Koa](/docs/latest/web/#koa)
* [Pino with Node core `http`](/docs/latest/web/#http)
* [Pino with Nest](/docs/latest/web/#nest)
* [Pino with Hono](/docs/latest/web/#hono)

<a name="essentials"></a>
## Essentials

### Development Formatting

The [`pino-pretty`](https://github.com/pinojs/pino-pretty) module can be used to
format logs during development:

![pretty demo](https://raw.githubusercontent.com/pinojs/pino/v10.4.0/pretty-demo.png)

### Transports & Log Processing

Due to Node's single-threaded event-loop, it's highly recommended that sending,
alert triggering, reformatting, and all forms of log processing
are conducted in a separate process or thread.

In Pino terminology, we call all log processors "transports" and recommend that the
transports be run in a worker thread using our `pino.transport` API.

For more details see our [Transports⇗](/docs/latest/transports/) document.

### Low overhead

Using minimum resources for logging is very important. Log messages
tend to get added over time and this can lead to a throttling effect
on applications – such as reduced requests per second.

In many cases, Pino is over 5x faster than alternatives.

See the [Benchmarks](/docs/latest/benchmarks/) document for comparisons.

### Bundling support

Pino supports being bundled using tools like webpack or esbuild. 

See [Bundling](/docs/latest/bundling/) document for more information.