2.0.6 • Published 7 years ago

exwml v2.0.6

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
7 years ago

express-logger

Logger utils and middleware build upon winstonjs, severity levels is syslog based.

Build Status

Test

$ npm test

configuration

  • process.env.LOG_FORMAT e.g pretty to generate human readable logs
  • process.env.LOG_LEVEL e.g debug, default is info or debug based on your NODE_ENV
  • process.env.LOG_SUPPRESS with value true to suppress all logs (when you run some test, maybe)

Usage

  • logger object is available globally, and it provide syslog levels { emerg: 0, alert: 1, crit: 2, error: 3, warning: 4, notice: 5, info: 6, debug: 7 }.

  • middleware

    • XRequestId()

      express req.id will be read from req.headers['x-request-id'] and concatenated with the package name or new one is created for this request, and it will be available in request response headers as x-request-id.

      var XRequestId      = require('exwml').XRequestId;
      var app = express();
      app.use(XRequestId());
    • expressWinston()

      log all details about any incoming request such as headers, params, responseTime ...

      var expressWinston      = require('exwml').expressWinston;
      var app = express();
      app.use(expressWinston());

security

  • meta object keys (case insensitive) ['password', 'pwd', 'auth', 'authorization', 'cfg'] will be REDACTED
2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

1.4.5

7 years ago

2.0.1

7 years ago

1.4.4

7 years ago

2.0.0

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

8 years ago