Skip to content

Commit

Permalink
controllers: Use ISO 8601 timestamp format in logs
Browse files Browse the repository at this point in the history
Use ISO 8601 for better timestamp redability
from logs.

we can also use kubectl logs --timestamps=true
options for timestamp.

Ref: RamenDR/ramen#499

Signed-off-by: Madhu Rajanna <[email protected]>
  • Loading branch information
Madhu-1 authored and mergify[bot] committed Aug 23, 2022
1 parent 2e63ef1 commit a04f2cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"

"go.uber.org/zap/zapcore"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
Expand Down Expand Up @@ -72,6 +73,7 @@ func main() {
flag.IntVar(&maxConcurrentReconciles, "max-concurrent-reconciles", 100, "Maximum number of concurrent reconciles")
opts := zap.Options{
Development: true,
TimeEncoder: zapcore.ISO8601TimeEncoder,
}
opts.BindFlags(flag.CommandLine)
flag.Parse()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/operator-framework/operator-sdk v1.22.2
github.com/robfig/cron/v3 v3.0.1
github.com/stretchr/testify v1.8.0
go.uber.org/zap v1.19.1
google.golang.org/grpc v1.48.0
google.golang.org/protobuf v1.28.1
k8s.io/api v0.24.4
Expand Down Expand Up @@ -207,7 +208,6 @@ require (
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20220408190544-5352b0902921 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
Expand Down

0 comments on commit a04f2cc

Please sign in to comment.