-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve logging #1160
Improve logging #1160
Conversation
backend/src/services/log.ts
Outdated
function ProductionStream() { | ||
return { | ||
write: (log) => { | ||
const namespace = getNamespace('my session') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this 'bailo' or equivalent?
backend/src/services/log.ts
Outdated
@@ -147,7 +157,8 @@ if (process.env.NODE_ENV !== 'production') { | |||
// In production environments output plain JSON logs | |||
streams.push({ | |||
level: config.log.level, | |||
stream: process.stdout, | |||
type: 'raw', | |||
stream: ProductionStream(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm inclined to say that we should add elasticsearch to our dev environments too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you expand on this, are there changes you're suggesting for this PR?
req.log = log.child({ | ||
id: req.reqId, | ||
user: req.user?.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we losing user from the request logs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines did nothing because the middleware that added the user to the request obtain had been run yet.
No description provided.