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

Middleware logger makes it difficult to debug #348

Open
jacobweinstock opened this issue Apr 15, 2024 · 0 comments
Open

Middleware logger makes it difficult to debug #348

jacobweinstock opened this issue Apr 15, 2024 · 0 comments

Comments

@jacobweinstock
Copy link
Member

Currently handlers use ctx.AbortWithError to return errors. The logger in middleware (

func Middleware(logger logr.Logger) gin.HandlerFunc {
) then handles logging error messages. This causes all log lines to report the same caller location. hegel/internal/logger/logger.go:53
event.Error(errors.New(msg), "all_errors", errs)

This makes debugging challenging and logging of the caller pointless.

Expected Behaviour

Current Behaviour

Possible Solution

One option could be to pass a logger into all handlers. I'm certain there are are others but i'll need to dig into the code and this space mentally a bit more.

Steps to Reproduce (for bugs)

Context

Your Environment

  • Operating System and version (e.g. Linux, Windows, MacOS):

  • How are you running Tinkerbell? Using Vagrant & VirtualBox, Vagrant & Libvirt, on Packet using Terraform, or give details:

  • Link to your project or a code example to reproduce issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant