Sunday, January 5, 2020

node.js: morgan deprecated default format: use combined format



>PROBLEM

The server throws the following server's message:
  morgan deprecated default format: use combined format

>SOLUTIONS

>>POSSIBILITY #1 ----------------------------------

BEFORE:
app.use(logger);


AFTER:
app.use(logger('combined'));


@FROM:
stackoverflow.com/questions/36397812/morgan-deprecated-expressjs/36398066


>>POSSIBILITY #2 ----------------------------------

BEFORE:
app.use(logger(process.env.AMBIENTE));
...
require('dotenv').config();


AFTER:
require('dotenv').config();
..
app.use(logger(process.env.AMBIENTE));

No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...