1770 update log format and add additional fields to webhook server logs (#1771)
* 1770 update log format and add runID and Id to worflow logs update tests, change log format for controllers.HorizontalRunnerAutoscalerGitHubWebhook use logging package remove unused modules add setup name to setuplog add flag to change log format change flag name to enableProdLogConfig move log opts to logger package remove empty else and reset timeEncoder update flag description use get function to handle nil rename flag and update logger function Update main.go Co-authored-by: Yusuke Kuoka <[email protected]> Update controllers/horizontal_runner_autoscaler_webhook.go Co-authored-by: Yusuke Kuoka <[email protected]> Update logging/logger.go Co-authored-by: Yusuke Kuoka <[email protected]> copy log opt per each NewLogger call revert to use autoscaler.log update flag descript and remove unused imports add logFormat to readme rename setupLog to logger make fmt * Fix E2E along the way Co-authored-by: Yusuke Kuoka <[email protected]>
This commit is contained in:
co-authored by
Yusuke Kuoka
parent
63e8f32281
commit
fbdfe0df8c
@@ -379,6 +379,7 @@ type env struct {
|
||||
runnerGracefulStopTimeout string
|
||||
runnerTerminationGracePeriodSeconds string
|
||||
runnerNamespace string
|
||||
logFormat string
|
||||
remoteKubeconfig string
|
||||
imagePullSecretName string
|
||||
imagePullPolicy string
|
||||
@@ -511,6 +512,7 @@ func initTestEnv(t *testing.T, k8sMinorVer string, vars vars) *env {
|
||||
e.runnerTerminationGracePeriodSeconds = testing.Getenv(t, "TEST_RUNNER_TERMINATION_GRACE_PERIOD_SECONDS", "30")
|
||||
e.runnerGracefulStopTimeout = testing.Getenv(t, "TEST_RUNNER_GRACEFUL_STOP_TIMEOUT", "15")
|
||||
e.runnerNamespace = testing.Getenv(t, "TEST_RUNNER_NAMESPACE", "default")
|
||||
e.logFormat = testing.Getenv(t, "ARC_E2E_LOG_FORMAT", "")
|
||||
e.remoteKubeconfig = testing.Getenv(t, "ARC_E2E_REMOTE_KUBECONFIG", "")
|
||||
e.imagePullSecretName = testing.Getenv(t, "ARC_E2E_IMAGE_PULL_SECRET_NAME", "")
|
||||
e.vars = vars
|
||||
@@ -706,6 +708,12 @@ func (e *env) installActionsRunnerController(t *testing.T, repo, tag, testID, ch
|
||||
)
|
||||
}
|
||||
|
||||
if e.logFormat != "" {
|
||||
varEnv = append(varEnv,
|
||||
"LOG_FORMAT="+e.logFormat,
|
||||
)
|
||||
}
|
||||
|
||||
scriptEnv = append(scriptEnv, varEnv...)
|
||||
scriptEnv = append(scriptEnv, e.vars.commonScriptEnv...)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user