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

Structured logging hides contents of interface objects #358

Open
uablrek opened this issue Feb 6, 2023 · 1 comment
Open

Structured logging hides contents of interface objects #358

uablrek opened this issue Feb 6, 2023 · 1 comment
Labels
kind/bug Something isn't working

Comments

@uablrek
Copy link
Contributor

uablrek commented Feb 6, 2023

Describe the bug

Some (quite many) go objects in Meridio are really interfaces. When used for output in structured logging the contents is empty {}. Example;

lb.logger.Info("AddTarget", "target", target)

To Reproduce

Check the load-balancer logs:

# kubectl logs -n red -c stateless-lb meridio-load-balancer-7549d49c9f-f28xz | jq
...
{
  "severity": "info",
  "timestamp": "2023-02-06T09:29:37.965+00:00",
  "service_id": "Meridio-LB",
  "message": "AddTarget",
  "version": "1.0.0",
  "extra_data": {
    "class": "LoadBalancer",
    "instance": "stream1",
    "target": {}
  }
}

Expected behavior

Useful logging

@uablrek uablrek self-assigned this Feb 6, 2023
@uablrek uablrek added the kind/bug Something isn't working label Feb 6, 2023
@LionelJouin LionelJouin moved this to 📋 To Do in Meridio Feb 6, 2023
@uablrek
Copy link
Contributor Author

uablrek commented Feb 6, 2023

Interface classes may be needed, but they should not be over-used since they basically trashes structured logging.

An overhaul is needed to log specific getters in interface objects rather than the objects themselves. This goes somewhat against the idea of structured logging.

@uablrek uablrek removed their assignment May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: 📋 To Do
Development

No branches or pull requests

1 participant