fastify / one-line-logger

Helps you format fastify's log into a nice one line message
MIT License
32 stars 7 forks source link

A basic one line format #1

Closed TommyDew42 closed 2 years ago

TommyDew42 commented 2 years ago

closes fastify/fastify#4027

How does the log look like

YYYY-MM-dd HH:mm:ss.SSSTZ - <level> - <method> <route path> - <message>

The logs look like this:

Screenshot 2022-08-14 at 2 50 57 AM

Unit tests

The following unit tests are included:


I believe without doing anything, we have already allowed the following usage:

fastify({
  logger: {
    transport: 'one-line-logger'
  }
})

It's because pino uses require.resolve('one-line-logger') to look for the path to main file of this package.

Checklist

TommyDew42 commented 2 years ago

Also updated the PR description for the timezone and color!

TommyDew42 commented 2 years ago

@mcollina ops sorry pushed a commit about readme. 😓 can you help run check again?