Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
bunyan-postgres-stream
Advanced tools
Store your Bunyan logs in PostgreSQL.
This module creates a Bunyan stream that maps the default log fields to table columns and also records the entire log message in a jsonb
column to support your custom fields.
Requires PostgreSQL 9.4 or above for use with jsonb
column types.
$ npm install --save bunyan-postgres-stream
First, create the table you want to store your logs in:
create table if not exists "public"."logs" (
"id" serial primary key,
"name" text,
"level" integer,
"hostname" text,
"msg" text,
"pid" integer,
"time" timestamptz,
"content" jsonb
)
Then, use the package as a Bunyan stream:
const bunyan = require('bunyan')
const bunyanPostgresStream = require('./')
const stream = bunyanPostgresStream({
connection: {
host: 'localhost',
user: 'postgres',
password: 'password',
database: 'db'
},
tableName: 'logs'
})
const log = bunyan.createLogger({
name: 'postgres stream',
level: 'info',
stream
})
log.info('something happened')
// explicity dispose of the database connection pool
stream.end()
Type: object
One of the following:
Type: string
The name of the table that will contain the logs.
Pull requests welcome.
MIT © Forrest Desjardins
FAQs
A bunyan stream for PostgreSQL
We found that bunyan-postgres-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.