You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// app/main.js// other imports etcimport{cabin}from'./configs/logging.js'// ...exportconstapp=newKoa()// ...app.use(cabin.middleware)// register other middlewares and routes here, at app/main.js
in the index.js at project root, i import my app and start to listen at 3000.
but then whenever i make a request, file name appearing is from the entrypoint, index.js:
[nodemon] restarting due to changes...
[nodemon] starting `node -r dotenv-flow/config index.js`
http://localhost:3000
[17/06/2024] [20:38:15] [index.js] › ℹ info ::1 GET /login HTTP/1.1 200 104 - -
[17/06/2024] [20:42:58] [index.js] › ℹ info ::1 GET / HTTP/1.1 302 43 - -
[17/06/2024] [20:42:58] [index.js] › ℹ info ::1 GET /login HTTP/1.1 200 104 - -
Is there a way to make it app.js, or even board-requests.js ?
Is it even related to Cabin or is it more related to Signale?
Is there any alternative to get the correct filename or explicitly it in logs?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
right now i have this logging setup:
then i register it in this way:
in the index.js at project root, i import my app and start to listen at 3000.
but then whenever i make a request, file name appearing is from the entrypoint, index.js:
[nodemon] restarting due to changes... [nodemon] starting `node -r dotenv-flow/config index.js` http://localhost:3000 [17/06/2024] [20:38:15] [index.js] › ℹ info ::1 GET /login HTTP/1.1 200 104 - - [17/06/2024] [20:42:58] [index.js] › ℹ info ::1 GET / HTTP/1.1 302 43 - - [17/06/2024] [20:42:58] [index.js] › ℹ info ::1 GET /login HTTP/1.1 200 104 - -
Is there a way to make it
app.js
, or evenboard-requests.js
?Is it even related to Cabin or is it more related to Signale?
Is there any alternative to get the correct filename or explicitly it in logs?
Any guidance is very welcome.
edit: sample code here.
Beta Was this translation helpful? Give feedback.
All reactions