https://github.com/aldis-ameriks/pino-postgres
Pino transport for Postgres
https://github.com/aldis-ameriks/pino-postgres
logs node pino postgres postgresql transport
Last synced: 9 months ago
JSON representation
Pino transport for Postgres
- Host: GitHub
- URL: https://github.com/aldis-ameriks/pino-postgres
- Owner: aldis-ameriks
- License: mit
- Created: 2020-08-29T08:20:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-05T16:47:06.000Z (over 1 year ago)
- Last Synced: 2025-03-25T20:45:32.622Z (10 months ago)
- Topics: logs, node, pino, postgres, postgresql, transport
- Language: JavaScript
- Homepage:
- Size: 48.8 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Welcome to pino-postgres 👋
> Pino transport for Postgres
## Install
```sh
$ npm install pino-postgres
# or
$ yarn add pino-postgres
```
## Usage
```
Usage: pino-postgres [options]
Options:
-V, --version output the version number
--connection postgres connection string
--table table name (default: "logs")
--schema schema name (default: "public")
--column column name (default: "content")
--flush-interval interval at which logs are flushed in ms (default: 5000)
--buffer-size max number of log entries in buffer (default: 1000)
--max-connections max number of connections (default: 3)
--ssl use ssl (default: false)
--debug debug postgres client (default: false)
--pass-through pass logs through (default: false)
--wrap-non-json wrap non-json messages as json (default: false)
-h, --help display help for command
```
```
node app.js | pino-postgres --connection postgres://username:password@localhost:5432/database
```
> pino-postgres does not create the necessary database table, make sure the table with jsonb column exists.
## Contributing
Contributions, issues and feature requests are welcome!
## License
Copyright © 2020 [Aldis Ameriks](https://github.com/aldis-ameriks).
This project is [MIT](https://github.com/aldis-ameriks/pino-postgres/blob/master/LICENSE) licensed.