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

Logging with logrus #8

Open
tomcat-bit opened this issue May 31, 2021 · 0 comments
Open

Logging with logrus #8

tomcat-bit opened this issue May 31, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@tomcat-bit
Copy link
Collaborator

Lohpi uses logrus to output logs with different logging levels. We should enhance the logging by using the logrus.WithFields type. This enables us to use structured formats when logging events. Further, all logging should be outputted to logfiles.

Normally, when we import log "github.com/sirupsen/logrus" it is used statically. If it is instantiated, it is advised to use it as a global variable. We should take a look at creating a logrus instance that is accessible in each of the packages that imports it. See logrus.New(). The instance should be enabled with logrus.WithFields and called with those fields available.

The following is a list of events that must be logged in a structured format:

  • All incoming HTTP requests.
  • All HTTP-related events that require attention.
  • All error values.
  • The bootstrapping process and all configuration being used (excluding database connection string and other Azure Key Vault data).
  • Graceful shutdown of all resources.
  • Sending and receiving of Ifrit messages and gRPC messages.
@tomcat-bit tomcat-bit added the enhancement New feature or request label May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant