openshift-online / maestro

Maestro Service Repo
Apache License 2.0
11 stars 20 forks source link

enhance log format using zapr logger. #195

Closed morvencao closed 1 month ago

morvencao commented 2 months ago

ref: https://issues.redhat.com/browse/ACM-14209

This PR introduces the following changes:

Before this PR:

$ kc -n maestro logs deploy/maestro | head -3
I0826 16:01:43.167516       1 logger.go:103]  Received event from channel [status_events] : ffc0317d-4f73-4826-b9c9-1cebd3a4197f
I0826 16:01:43.186375       1 logger.go:103]  Broadcast the resource status 0d555480-f93b-57da-aab0-1269547348ac
I0826 16:01:43.236294       1 logger.go:103]  Broadcast the resource status fc396131-dc49-5587-9564-70f49d853a1a

After this PR:

$ kc -n maestro logs deploy/maestro | head -20
2024-09-12T08:40:06.976Z    INFO    environments/framework.go:79    Initializing development environment
2024-09-12T08:40:06.981Z    INFO    environments/framework.go:165   Using Mock OCM Authz Client
2024-09-12T08:40:06.993Z    LEVEL(-3)   cert/cert_rotation.go:56    Starting client certificate rotation controller
2024-09-12T08:40:06.999Z    INFO    clientcmd/client_config.go:659  Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
2024-09-12T08:40:06.999Z    INFO    environments/framework.go:243   Disabling Sentry error reporting
2024-09-12T08:40:07.000Z    INFO    servecmd/cmd.go:49  Setting up pulse server
2024-09-12T08:40:07.002Z    INFO    server/grpc_server.go:113   Serving gRPC service with TLS at 8090
2024-09-12T08:40:07.002Z    LEVEL(-5)   channelz/logging.go:31  [core] [Server #1]Server created

2024-09-12T08:40:07.002Z    DEBUG   logger/logger.go:103     Kind controller handling events
2024-09-12T08:40:07.002Z    DEBUG   logger/logger.go:103     Status controller handling events
2024-09-12T08:40:07.002Z    INFO    server/healthcheck_server.go:53 Serving HealthCheck with TLS at 8083
2024-09-12T08:40:07.002Z    DEBUG   logger/logger.go:103     Starting event controller
2024-09-12T08:40:07.002Z    DEBUG   logger/logger.go:103     Starting pulse server
2024-09-12T08:40:07.002Z    LEVEL(-10)  logger/logger.go:103     Checking liveness of maestro instances
2024-09-12T08:40:07.003Z    INFO    server/api_server.go:148    Serving with TLS at 8000
2024-09-12T08:40:07.003Z    INFO    event/event.go:75   Starting event broadcaster
2024-09-12T08:40:07.003Z    DEBUG   logger/logger.go:103     Kind controller listening for events
2024-09-12T08:40:07.003Z    DEBUG   logger/logger.go:103     Status controller listening for status events
2024-09-12T08:40:07.003Z    DEBUG   logger/logger.go:103     Serving Metrics without TLS at 8080
morvencao commented 2 months ago

/assign @qiujian16 @clyang82 @skeeey

clyang82 commented 1 month ago

/ok-to-test