Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Harmonize logging with SugaredLogger to avoid wrong formatting #265

Conversation

gabriel-farache
Copy link
Contributor

Fix the wrong formatting when using SugaredLogger

Current:

2022-06-08T12:51:50.150+0300    INFO    httpapi/main.go:158     cannot verify request:authType0methodGETurl/api/flotta-management/v1/control/07b68c4e41b04cb987ef171766c01147/inerrcannot use register certificate on this resource 
2022-06-08T12:51:50.150+0300    INFO    httpapi/main.go:158     cannot verify request:authType0methodGETurl/api/flotta-management/v1/data/07b68c4e41b04cb987ef171766c01147/inerrcannot use register certificate on this resource 
       2022-06-08T12:51:55.155+0300    INFO    httpapi/main.go:158     cannot verify request:authType0methodGETurl/api/flotta-management/v1/control/07b68c4e41b04cb987ef171766c01147/inerrcannot use register certificate on this resource 
2022-06-08T12:51:55.156+0300    INFO    httpapi/main.go:158     cannot verify request:authType0methodGETurl/api/flotta-management/v1/data/07b68c4e41b04cb987ef171766c01147/inerrcannot use register certificate on this resource 
2022-06-08T12:51:55.411+0300    ERROR   yggdrasil/yggdrasil.go:238      forbiddencan't get target namespace for a device        {"DeviceID": "07b68c4e41b04cb987ef171766c01147"}

After fix:

2022-06-15T14:39:36.833Z        INFO    workspace/main.go:158   cannot verify request   {"authType": 0, "method": "GET", "url": "/api/flotta-management/v1/control/3251c266033744c088c4e4db3074f7fa/in", "err": "cannot use register certificate on this resource"}
2022-06-15T14:39:41.838Z        INFO    workspace/main.go:158   cannot verify request   {"authType": 0, "method": "GET", "url": "/api/flotta-management/v1/control/3251c266033744c088c4e4db3074f7fa/in", "err": "cannot use register certificate on this resource"}
2022-06-15T14:39:41.838Z        INFO    workspace/main.go:158   cannot verify request   {"authType": 0, "method": "GET", "url": "/api/flotta-management/v1/data/3251c266033744c088c4e4db3074f7fa/in", "err": "cannot use register certificate on this resource"}
2022-06-15T14:39:46.840Z        INFO    workspace/main.go:158   cannot verify request   {"authType": 0, "method": "GET", "url": "/api/flotta-management/v1/data/3251c266033744c088c4e4db3074f7fa/in", "err": "cannot use register certificate on this resource"}
2022-06-15T14:39:46.840Z        INFO    workspace/main.go:158   cannot verify request   {"authType": 0, "method": "GET", "url": "/api/flotta-management/v1/control/3251c266033744c088c4e4db3074f7fa/in", "err": "cannot use register certificate on this resource"}

Signed-off-by: Gabriel Farache [email protected]

@openshift-ci openshift-ci bot requested review from arielireni and ygalblum June 15, 2022 14:40
@gabriel-farache gabriel-farache requested review from masayag and jakub-dzon and removed request for ygalblum, arielireni and masayag June 15, 2022 14:40
@gabriel-farache gabriel-farache requested a review from masayag June 15, 2022 14:40
@eloycoto
Copy link
Collaborator

<3 thanks!

@pkliczewski
Copy link
Collaborator

looks good to me

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 17, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gabriel-farache, jakub-dzon, machacekondra, masayag

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [gabriel-farache,jakub-dzon,machacekondra,masayag]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gabriel-farache gabriel-farache force-pushed the fix/suggaredlogger_messages_formatting branch from cad408b to be34a9b Compare June 21, 2022 15:55
@openshift-ci openshift-ci bot removed the lgtm label Jun 21, 2022
@jakub-dzon
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jun 22, 2022
@jakub-dzon
Copy link
Collaborator

/test unit-fast

@openshift-ci openshift-ci bot merged commit 1b88d28 into project-flotta:main Jun 22, 2022
@gabriel-farache gabriel-farache deleted the fix/suggaredlogger_messages_formatting branch June 22, 2022 09:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants