Skip to content
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

Merged
merged 3 commits into from
Mar 26, 2024
Merged

Improve logging #1160

merged 3 commits into from
Mar 26, 2024

Conversation

JR40159
Copy link
Member

@JR40159 JR40159 commented Mar 12, 2024

No description provided.

function ProductionStream() {
return {
write: (log) => {
const namespace = getNamespace('my session')
Copy link
Member

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?

@@ -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(),
Copy link
Member

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!

Copy link
Member Author

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,
Copy link
Member

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?

Copy link
Member Author

@JR40159 JR40159 Mar 19, 2024

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.

@JR40159 JR40159 merged commit e7d1fec into main Mar 26, 2024
14 checks passed
@JR40159 JR40159 deleted the feature/improve-logging branch March 26, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants