Skip to content

Commit d23e6ac

Browse files
authored
feat: configurable log timestamp format (argoproj#21478)
* feat: configurable log timestamp format Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * lint Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
1 parent 9a51757 commit d23e6ac

21 files changed

+377
-4
lines changed

common/common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ const (
277277
EnvLogLevel = "ARGOCD_LOG_LEVEL"
278278
// EnvLogFormatEnableFullTimestamp enables the FullTimestamp option in logs
279279
EnvLogFormatEnableFullTimestamp = "ARGOCD_LOG_FORMAT_ENABLE_FULL_TIMESTAMP"
280+
// EnvLogFormatTimestamp is the timestamp format used in logs
281+
EnvLogFormatTimestamp = "ARGOCD_LOG_FORMAT_TIMESTAMP"
280282
// EnvMaxCookieNumber max number of chunks a cookie can be broken into
281283
EnvMaxCookieNumber = "ARGOCD_MAX_COOKIE_NUMBER"
282284
// EnvPluginSockFilePath allows to override the pluginSockFilePath for repo server and cmp server

docs/operator-manual/argocd-cmd-params-cm.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ data:
3636
# Feature state: Beta
3737
application.namespaces: ns1, ns2, ns3
3838

39+
# Set the logging timestamp format. The default is "" which means "2006-01-02T15:04:05Z07:00" (RFC3339).
40+
# See https://pkg.go.dev/time#pkg-constants for more options.
41+
# This option is used for all components.
42+
log.format.timestamp: ""
43+
3944
## Controller Properties
4045
# Repo server RPC call timeout seconds.
4146
controller.repo.server.timeout.seconds: "60"

manifests/base/application-controller-deployment/argocd-application-controller-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ spec:
8585
name: argocd-cmd-params-cm
8686
key: controller.log.level
8787
optional: true
88+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
89+
valueFrom:
90+
configMapKeyRef:
91+
name: argocd-cmd-params-cm
92+
key: log.format.timestamp
93+
optional: true
8894
- name: ARGOCD_APPLICATION_CONTROLLER_METRICS_CACHE_EXPIRATION
8995
valueFrom:
9096
configMapKeyRef:

manifests/base/application-controller/argocd-application-controller-statefulset.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ spec:
8888
name: argocd-cmd-params-cm
8989
key: controller.log.level
9090
optional: true
91+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
92+
valueFrom:
93+
configMapKeyRef:
94+
name: argocd-cmd-params-cm
95+
key: log.format.timestamp
96+
optional: true
9197
- name: ARGOCD_APPLICATION_CONTROLLER_METRICS_CACHE_EXPIRATION
9298
valueFrom:
9399
configMapKeyRef:

manifests/base/applicationset-controller/argocd-applicationset-controller-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ spec:
8585
key: applicationsetcontroller.log.level
8686
name: argocd-cmd-params-cm
8787
optional: true
88+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
89+
valueFrom:
90+
configMapKeyRef:
91+
name: argocd-cmd-params-cm
92+
key: log.format.timestamp
93+
optional: true
8894
- name: ARGOCD_APPLICATIONSET_CONTROLLER_DRY_RUN
8995
valueFrom:
9096
configMapKeyRef:

manifests/base/commit-server/argocd-commit-server-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ spec:
4848
name: argocd-cmd-params-cm
4949
key: commitserver.log.level
5050
optional: true
51+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
52+
valueFrom:
53+
configMapKeyRef:
54+
name: argocd-cmd-params-cm
55+
key: log.format.timestamp
56+
optional: true
5157
ports:
5258
- containerPort: 8086
5359
- containerPort: 8087

manifests/base/dex/argocd-dex-server-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ spec:
5353
key: dexserver.log.level
5454
name: argocd-cmd-params-cm
5555
optional: true
56+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
57+
valueFrom:
58+
configMapKeyRef:
59+
name: argocd-cmd-params-cm
60+
key: log.format.timestamp
61+
optional: true
5662
- name: ARGOCD_DEX_SERVER_DISABLE_TLS
5763
valueFrom:
5864
configMapKeyRef:

manifests/base/notification/argocd-notifications-controller-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ spec:
4848
key: notificationscontroller.log.level
4949
name: argocd-cmd-params-cm
5050
optional: true
51+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
52+
valueFrom:
53+
configMapKeyRef:
54+
name: argocd-cmd-params-cm
55+
key: log.format.timestamp
56+
optional: true
5157
- name: ARGOCD_APPLICATION_NAMESPACES
5258
valueFrom:
5359
configMapKeyRef:

manifests/base/repo-server/argocd-repo-server-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ spec:
4747
name: argocd-cmd-params-cm
4848
key: reposerver.log.level
4949
optional: true
50+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
51+
valueFrom:
52+
configMapKeyRef:
53+
name: argocd-cmd-params-cm
54+
key: log.format.timestamp
55+
optional: true
5056
- name: ARGOCD_REPO_SERVER_PARALLELISM_LIMIT
5157
valueFrom:
5258
configMapKeyRef:

manifests/core-install-with-hydrator.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24075,6 +24075,12 @@ spec:
2407524075
key: applicationsetcontroller.log.level
2407624076
name: argocd-cmd-params-cm
2407724077
optional: true
24078+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
24079+
valueFrom:
24080+
configMapKeyRef:
24081+
key: log.format.timestamp
24082+
name: argocd-cmd-params-cm
24083+
optional: true
2407824084
- name: ARGOCD_APPLICATIONSET_CONTROLLER_DRY_RUN
2407924085
valueFrom:
2408024086
configMapKeyRef:
@@ -24285,6 +24291,12 @@ spec:
2428524291
key: commitserver.log.level
2428624292
name: argocd-cmd-params-cm
2428724293
optional: true
24294+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
24295+
valueFrom:
24296+
configMapKeyRef:
24297+
key: log.format.timestamp
24298+
name: argocd-cmd-params-cm
24299+
optional: true
2428824300
image: quay.io/argoproj/argocd:latest
2428924301
imagePullPolicy: Always
2429024302
livenessProbe:
@@ -24516,6 +24528,12 @@ spec:
2451624528
key: reposerver.log.level
2451724529
name: argocd-cmd-params-cm
2451824530
optional: true
24531+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
24532+
valueFrom:
24533+
configMapKeyRef:
24534+
key: log.format.timestamp
24535+
name: argocd-cmd-params-cm
24536+
optional: true
2451924537
- name: ARGOCD_REPO_SERVER_PARALLELISM_LIMIT
2452024538
valueFrom:
2452124539
configMapKeyRef:
@@ -24902,6 +24920,12 @@ spec:
2490224920
key: controller.log.level
2490324921
name: argocd-cmd-params-cm
2490424922
optional: true
24923+
- name: ARGOCD_LOG_FORMAT_TIMESTAMP
24924+
valueFrom:
24925+
configMapKeyRef:
24926+
key: log.format.timestamp
24927+
name: argocd-cmd-params-cm
24928+
optional: true
2490524929
- name: ARGOCD_APPLICATION_CONTROLLER_METRICS_CACHE_EXPIRATION
2490624930
valueFrom:
2490724931
configMapKeyRef:

0 commit comments

Comments
 (0)