Basic Node and Express - Implement a Root-Level Request Logger Middleware

Tell us what’s happening:

got error : Failed: Root level logger middleware should be active

Seems this Problem was often reported and feels not solved: Basic Node and Express - Implement a Root-Level Request Logger Middleware - #13 by lychenus

i tried:

let express = require('express');
let app = express();
app.use((req, res, next)=> {
  console.log(`${req.method} ${req.path} - ${req.ip}`);
  next();
});

and

let express = require('express');
let app = express();
app.use((req, res, next) => {
 let string = `${req.method} ${req.path} - ${req.ip}`
 console.log(string) 
  next();
});

Your project link(s)

solution: boilerplate-express - Replit

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0

Challenge: Basic Node and Express - Implement a Root-Level Request Logger Middleware

Link to the challenge:

now works. there was a typo of one single letter

:laughing: It happens to me all the time…

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.