0.9.15 • Published 2 years ago

shadow-logger v0.9.15

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

shadow-logger

Pino.js stream Debugger dashboard

Install

Install with either npm or yarn

npm install shadow-logger
yarn add shadow-logger

1. Add pino.js stream

import { pinoTransport } from 'shadow-logger';

const streams = [
  {
    level: 'trace', stream: pinoTransport({
      s3Bucket: 'express-logger',
      s3Prefix: `cupid-${process.env.NODE_ENV}`,
    })
  }
]

const logger = pino({
  ...
}, pino.multistream(streams));

export default logger;

2. Add shadowMiddleware

const app = express();
app.use(shadowMiddleware())

3. Add debugger middleware

app.use('/debug', shadowDebugger({
  s3Bucket: 'express-logger',
  s3Prefix: `/cupid-${process.env.NODE_ENV}`,
}))
FieldRequiredDescription
s3BucketYesThe s3 bucket
s3PrefixYesThe prefix key for s3
awsConfigCredentialsNoThe object config for new S3Client(). By default it will try to login with default aws environment variables see: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html

This will serve the debugger on /debug.

4. Install debugger

npx shadow-logger install

Will install the dashboard static files on .debug/ by default.

Usage

After finishing the steps on installation the debugger should be available on /debug and write logs grouped by their request.

0.9.12

2 years ago

0.9.8

2 years ago

0.9.13

2 years ago

0.9.7

2 years ago

0.9.14

2 years ago

0.9.15

2 years ago

0.9.9

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.10

2 years ago

0.9.6

2 years ago

0.9.11

2 years ago

0.9.5

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.8.2

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.28

2 years ago

0.2.27

2 years ago

0.2.26

2 years ago

0.2.25

2 years ago