Skip to content

Commit

Permalink
chore: rename workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Xstoudi committed Mar 14, 2020
1 parent 18a4206 commit 04204dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js CI
name: Tests

on: [push]

Expand Down
31 changes: 5 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,13 @@ npm install pino-pg
## Usage
Write logs into PostgreSQL
```
node my-app.js | pino-pg -c configuration.json
node my-app.js | pino-pg --connectionUrl <your connection string> --table <your logs table> --column <your column table>
```

## Configuration file
The configuration file is a JSON file like this :
```json
{
"connection": {
"user": "postgres",
"database": "test-database",
"password": "",
"port": "",
"host": "127.0.0.1"
},
"table": "logs",
"columns": {
"level": "level",
"time": "time",
"pid": "pid",
"hostname": "hostname",
"msg": "msg",
"v": "v"
}
}
```
The `connection` field contains the [node-pg connection information](https://node-postgres.com/features/connecting#Programmatic).
The `table` field is the table where you want to store logs.
The `columns` field allows you to custom PostgreSQL column name for each pino field. Key is pino field, value is column name.
## Options
The `connectionUrl` (or `c`) must contain the [postgres url string](https://node-postgres.com/features/connecting#Connection%20URI).
The `table` (or `t`) must contain the table name. Default to `logs`.
The `column` (or `c`) must contain the name of the JSONB column where you want to store log entries.

## License
Licensed under [MIT](https://github.com/Xstoudi/pino-pg/blob/master/LICENSE.md)

0 comments on commit 04204dc

Please sign in to comment.