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

bump: joonix/log to NewFormater() #3342

Merged
merged 7 commits into from
Aug 26, 2023
Merged

Conversation

jonsch318
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking

/kind bug

/kind cleanup
/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:

Bump the version of joonix/log to the (new) joonix.NewFormatter().

I would suggest to remove the dependency all together. But at least keep the version up to date.

Which issue(s) this PR fixes:

Closes #3341

Special notes for your reviewer:

@google-cla
Copy link

google-cla bot commented Aug 22, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the kind/bug These are bugs. label Aug 22, 2023
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 162ee2ba-3ca8-4b55-8a44-ae90e8580f81

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3342/head:pr_3342 && git checkout pr_3342
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-513996e-amd64

@@ -36,7 +36,7 @@ type stackTracer interface {

// replace the standard glog error logger, with a logrus one
func init() {
logrus.SetFormatter(&joonix.FluentdFormatter{})
logrus.SetFormatter(joonix.NewFormatter())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the fields match exactly?

Copy link
Contributor Author

@jonsch318 jonsch318 Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fluentd format only uses three field: "time", "severity", "message". The issue joonix/log#2 sets the default JSONFormatter with a FieldMap as a alternative.

Which i have now used in the latest commit. and removed the dependency for joonix

@aimuz
Copy link
Collaborator

aimuz commented Aug 23, 2023

Can you give the log output before this change, as well as the log output after the change, for review?

@jonsch318
Copy link
Contributor Author

Actually then most of the dependency upgrades is unnecessary because I removed the dependency to joonix/log.

@aimuz
Copy link
Collaborator

aimuz commented Aug 23, 2023

If the log output is not affected, I believe this is a good change.

@jonsch318
Copy link
Contributor Author

Can you give the log output before this change, as well as the log output after the change, for review?

Yeah let me first try to run it where i can see some logs.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 0fd23497-46e3-4a51-bf31-f54a1a35cf57

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3342/head:pr_3342 && git checkout pr_3342
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-4ed9b78-amd64

@aimuz
Copy link
Collaborator

aimuz commented Aug 23, 2023

unchanged

{"message":"Player Disconnected","playerID":"1234","sdkName":"go","severity":"info","source":"*sdkserver.LocalSDKServer","time":"2023-08-23T00:27:37.928895153Z"}
{"message":"Gameserver update received","sdkName":"go","severity":"info","source":"*sdkserver.LocalSDKServer","time":"2023-08-23T00:27:37.928930197Z"}

changed

{"message":"Player Disconnected","playerID":"1234","sdkName":"go","severity":"info","source":"*sdkserver.LocalSDKServer","time":"2023-08-23T07:08:31Z"}
{"message":"Gameserver update received","sdkName":"go","severity":"info","source":"*sdkserver.LocalSDKServer","time":"2023-08-23T07:08:31Z"}

Looks like the format of the log has changed, Can you make it consistent?

@JohnnyS318

@@ -36,7 +35,13 @@ type stackTracer interface {

// replace the standard glog error logger, with a logrus one
func init() {
logrus.SetFormatter(&joonix.FluentdFormatter{})
logrus.SetFormatter(&logrus.JSONFormatter{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep the time format the same as before

@jonsch318
Copy link
Contributor Author

unchanged

{"message":"Player Disconnected","playerID":"1234","sdkName":"go","severity":"info","source":"*sdkserver.LocalSDKServer","time":"2023-08-23T00:27:37.928895153Z"}
{"message":"Gameserver update received","sdkName":"go","severity":"info","source":"*sdkserver.LocalSDKServer","time":"2023-08-23T00:27:37.928930197Z"}

changed

{"message":"Player Disconnected","playerID":"1234","sdkName":"go","severity":"info","source":"*sdkserver.LocalSDKServer","time":"2023-08-23T07:08:31Z"}
{"message":"Gameserver update received","sdkName":"go","severity":"info","source":"*sdkserver.LocalSDKServer","time":"2023-08-23T07:08:31Z"}

Looks like the format of the log has changed, Can you make it consistent?

@JohnnyS318

Should now be fixed. The FluentDFormatter used the RFC3339Nano timestamp format

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: dbcfff5a-e0ac-4a32-b940-f7909b01a088

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3342/head:pr_3342 && git checkout pr_3342
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-48a3ae2-amd64

Copy link
Collaborator

@aimuz aimuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@markmandel I think this is a good change, do you have time to look at it?

@google-oss-prow google-oss-prow bot added the lgtm label Aug 24, 2023
@markmandel markmandel requested review from zmerlynn and gongmax and removed request for cyriltovena August 24, 2023 21:21
@markmandel
Copy link
Member

markmandel commented Aug 24, 2023

LGTM, just dragging @gongmax and @zmerlynn in to triple check, since logger changes have such a wide impact.

I don't think the slight change in time format should matter.

"time":"2023-08-23T00:27:37.928930197Z" vs "time":"2023-08-23T07:08:31Z" - Not sure we are required to go to the sub-nano second here 😃

Copy link
Collaborator

@gongmax gongmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aimuz, gongmax, JohnnyS318
Once this PR has been reviewed and has the lgtm label, please assign alekser for approval. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

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

@jonsch318
Copy link
Contributor Author

LGTM, just dragging @gongmax and @zmerlynn in to triple check, since logger changes have such a wide impact.

I don't think the slight change in time format should matter.

"time":"2023-08-23T00:27:37.928930197Z" vs "time":"2023-08-23T07:08:31Z" - Not sure we are required to go to the sub-nano second here 😃

Actually I'm not shure why the time format has changed. I looked at the joonix/log commit specified in the dependency and it was also using RFC3339Nano as the time format. So it should be exactly equal.

@google-oss-prow google-oss-prow bot removed the lgtm label Aug 24, 2023
@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@markmandel markmandel enabled auto-merge (squash) August 24, 2023 22:20
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 35661960-721d-4e8d-8066-47d6ae1e919f

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@aimuz
Copy link
Collaborator

aimuz commented Aug 25, 2023

Is it possible to add a retest command? For quickly retrying incorrect tests

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: eb65a1c2-d3bc-4ec1-82f3-3a3075e5f698

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 87d0183d-711d-4fab-8697-025324ce51e9

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3342/head:pr_3342 && git checkout pr_3342
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-a0e7cd7-amd64

@markmandel markmandel merged commit 4d116d7 into googleforgames:main Aug 26, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug These are bugs. size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changed API of joonix/log
5 participants