Skip to content

Conversation

@squizzi
Copy link
Contributor

@squizzi squizzi commented Feb 6, 2025

InitLog has been renamed to New and InitLog now calls New, this allows us to get a localized new logger outside of the default Logger.

I tested this against PR: https://github.com/replicatedhq/vandoor/pull/6859

The eventLog logger instantiated with log.New fires in JSONFormatter but the other logger fires everything else:

{"caller":"cluster/event_log.go:49","cluster_guid":"7e95da15","cluster_name":"serene_wright","distribution":"fake","instance_types":["r1.small"],"level":"info","message":"cluster create resulted in error status","node_count":1,"node_groups":1,"status":"error","team_id":"2rMLsxkHYFV27t5oCfSyYOfVtNH","team_name":"Mango, Inc.","team_url":"https://admin.replbiz.com/teams/2rMLsxkHYFV27t5oCfSyYOfVtNH","timestamp":"2025/02/06 04:47:16","ttl":"1h","version":"1.37"}
[GIN] 2025/02/06 - 04:47:16 | 200 |   98.238281ms | 10.0.6.135 |   PUT     /internal/v3/reliability_matrix/cluster_provisioner
DEBUG 2025/02/06 04:47:16 /go/pkg/mod/github.com/replicatedcom/saaskit@v0.0.0-20250206043459-1b1d5ef61e42/log/gin.go:45 [GIN] 200 |   98.04784ms | 10.0.6.135 | PUT     /internal/v3/reliability_matrix/cluster_provisioner
ERROR 2025/02/06 04:47:16 cluster/cluster.go:2025 Failed to send slack notification for cluster 7e95da15: failed to update cluster event slack message: channel_not_found
[GIN] 2025/02/06 - 04:47:16 | 200 |   20.863855ms | 10.0.6.135 |   PUT     /internal/v3/reliability_matrix/cluster_provisioner_versions

Signed-off-by: Kyle Squizzato <kyle@replicated.com>
@squizzi squizzi requested a review from divolgin February 6, 2025 04:49
@squizzi squizzi merged commit e900742 into main Feb 6, 2025
1 check passed
@squizzi squizzi deleted the squizzi-newlogger branch February 6, 2025 17:29
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

Successfully merging this pull request may close these issues.

3 participants