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

Changing logging format to JSON #1214

Merged
merged 1 commit into from
Feb 2, 2022
Merged

Changing logging format to JSON #1214

merged 1 commit into from
Feb 2, 2022

Conversation

chaitanya-baraskar
Copy link
Contributor

Change Overview

Changed Kanister log format to JSON

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

  • #XXX

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

Built new Image as per local changes.
Uploaded it to personal repo and checked if logs are getting generated using kubectl logs command.
Attaching command output for reference

Logs before changes -

time="2022-01-31T10:12:38.171332079Z" level=info msg="Getting kubernetes context" File=pkg/kancontroller/kancontroller.go Function=github.com/kanisterio/kanister/pkg/kancontroller.Execute Line=57 cluster_name=9242a037-7608-43cb-ae60-bacb20329a95 hostname=myrelease-kanister-operator-d6df6bbbd-rfwdd
time="2022-01-31T10:12:39.845857633Z" level=info msg="Added blueprint mssql-blueprint" File=pkg/controller/controller.go Function="github.com/kanisterio/kanister/pkg/controller.(*Controller).onAddBlueprint" Line=212 cluster_name=9242a037-7608-43cb-ae60-bacb20329a95 hostname=myrelease-kanister-operator-d6df6bbbd-rfwdd
time="2022-01-31T10:12:39.859474415Z" level=error msg="Cannot initialize non-nil ActionSet Status" ActionSet=backup-p5hmz File=pkg/controller/controller.go Function="github.com/kanisterio/kanister/pkg/controller.(*Controller).onAddActionSet" Line=200 cluster_name=9242a037-7608-43cb-ae60-bacb20329a95 hostname=myrelease-kanister-operator-d6df6bbbd-rfwdd
time="2022-01-31T10:13:53.820014185Z" level=info msg="Executing action backup" ActionSet=backup-gbxtv File=pkg/controller/controller.go Function="github.com/kanisterio/kanister/pkg/controller.(*Controller).runAction" Line=379 cluster_name=9242a037-7608-43cb-ae60-bacb20329a95 hostname=myrelease-kanister-operator-d6df6bbbd-rfwdd
time="2022-01-31T10:13:53.894405748Z" level=info msg="Created actionset and started executing actions" ActionSet=backup-gbxtv File=pkg/controller/controller.go Function="github.com/kanisterio/kanister/pkg/controller.(*Controller).onAddActionSet" Line=208 NewActionSetName=backup-gbxtv cluster_name=9242a037-7608-43cb-ae60-bacb20329a95 hostname=myrelease-kanister-operator-d6df6bbbd-rfwdd

Logs After changes -

{"ActionSet":"backup-vnphz","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).runAction.func1","Line":401,"Phase":"dumpToObjectStore","cluster_name":"9242a037-7608-43cb-ae60-bacb20329a95","hostname":"myrelease-kanister-operator-6857d4f554-dvwt2","level":"info","msg":"Executing phase dumpToObjectStore","time":"2022-01-31T10:27:17.268995026Z"}
{"Actionset":"backup-vnphz","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":227,"Status":"failed","cluster_name":"9242a037-7608-43cb-ae60-bacb20329a95","hostname":"myrelease-kanister-operator-6857d4f554-dvwt2","level":"info","msg":"Updated ActionSet","time":"2022-01-31T10:27:17.301053963Z"}
{"ActionSet":"backup-vnphz","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).runAction.func1","Line":438,"Phase":"dumpToObjectStore","cluster_name":"9242a037-7608-43cb-ae60-bacb20329a95","error":"Failed to render template: \"mssql\" not found","hostname":"myrelease-kanister-operator-6857d4f554-dvwt2","level":"info","msg":"Failed to execute phase: v1alpha1.Phase{Name:\"dumpToObjectStore\", State:\"pending\", Output:map[string]interface {}(nil)}:","time":"2022-01-31T10:27:17.304327Z"}

@mergify mergify bot merged commit 45b58cf into master Feb 2, 2022
@mergify mergify bot deleted the json-output branch February 2, 2022 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants