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

Add better logging for backend components #3932

Closed
S-ayanide opened this issue Mar 24, 2023 · 7 comments
Closed

Add better logging for backend components #3932

S-ayanide opened this issue Mar 24, 2023 · 7 comments
Assignees
Labels
good first issue LFX-MENTORSHIP Linux Foundation Mentor ship Issue

Comments

@S-ayanide
Copy link
Member

Description

Currently, our server logs provide limited information, making it difficult to diagnose issues and track user activity. To address this, I propose that we enhance our server logs with additional fields that provide more context and insights.

Here are some suggested fields that we can add to our server logs:

  • Request metadata: Adding request metadata fields like request ID, request URL, and request method can help us identify and trace specific requests, making it easier to diagnose issues and track user activity.
  • User metadata: Adding user metadata fields like user ID, user IP address, and user agent can help us identify and track user activity, making it easier to monitor and analyze user behavior.
  • Server metadata: Adding server metadata fields like server hostname, server IP address, and server time can help us identify and diagnose issues related to server performance and availability.
  • Custom fields: Adding custom fields like application-specific metadata can help us track and analyze application-specific events and behaviors.

Implementation specifications

        logFields := logrus.Fields{
		"projectId": identifiers.ProjectIdentifier,
		"user": identifiers.User,
		"component": "GraphQL server"
	}

	logrus.WithFields(logFields).Info("request received to create a new delegate")

By adding these fields, we can significantly improve the quality and usefulness of our server logs, making it easier to diagnose issues, track user activity, and monitor server performance.

@S-ayanide S-ayanide added LFX-MENTORSHIP Linux Foundation Mentor ship Issue good first issue labels Mar 24, 2023
@S-ayanide
Copy link
Member Author

@namkyu1999 assigning this task to you, based on the server logging discussion as a part of LFX.

@namkyu1999
Copy link
Member

Good! I can handle it!

@JAYESHBATRA
Copy link

Is this issue still available ? If yes then please assign it to me.

@imrajdas
Copy link
Member

imrajdas commented Apr 6, 2023

Hi @JAYESHBATRA , these issues are part of LFX and our current mentee(@namkyu1999 ) is working on this. Please feel free to take any other open issue. Or apply for the next LFX term.

@imrajdas
Copy link
Member

imrajdas commented Apr 7, 2023

@JAYESHBATRA
Copy link

Hi @imrajdas ,

Sure, I'd be happy to take up the issues you've raised.

@S-ayanide
Copy link
Member Author

The updated logging setup has been merged, as an improvement we added parameters like method, URI, status, latency and clientIP with requests to structure as well as identify the logs better.

PR for reference: #3939

Closing this issue since the task has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue LFX-MENTORSHIP Linux Foundation Mentor ship Issue
Projects
None yet
Development

No branches or pull requests

4 participants