feat(traefik): Add support for JSON format logs (#2609)
* Add support for JSON format Traefik logs * Update log formats to use enums And improve documentation
This commit is contained in:
@@ -22,7 +22,7 @@ sources:
|
|||||||
- https://github.com/traefik/traefik-helm-chart
|
- https://github.com/traefik/traefik-helm-chart
|
||||||
- https://traefik.io/
|
- https://traefik.io/
|
||||||
type: application
|
type: application
|
||||||
version: 11.2.2
|
version: 11.3.0
|
||||||
annotations:
|
annotations:
|
||||||
truecharts.org/catagories: |
|
truecharts.org/catagories: |
|
||||||
- network
|
- network
|
||||||
|
|||||||
@@ -154,6 +154,16 @@ questions:
|
|||||||
description: "Panics"
|
description: "Panics"
|
||||||
- value: "DEBUG"
|
- value: "DEBUG"
|
||||||
description: "Debug"
|
description: "Debug"
|
||||||
|
- variable: format
|
||||||
|
label: "General Log format"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "common"
|
||||||
|
enum:
|
||||||
|
- value: "common"
|
||||||
|
description: "Common Log Format"
|
||||||
|
- value: "json"
|
||||||
|
description: "JSON"
|
||||||
- variable: access
|
- variable: access
|
||||||
label: "Access Logs"
|
label: "Access Logs"
|
||||||
schema:
|
schema:
|
||||||
@@ -233,7 +243,16 @@ questions:
|
|||||||
description: "Keep"
|
description: "Keep"
|
||||||
- value: "drop"
|
- value: "drop"
|
||||||
description: "Drop"
|
description: "Drop"
|
||||||
|
- variable: format
|
||||||
|
label: "Access Log format"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "common"
|
||||||
|
enum:
|
||||||
|
- value: "common"
|
||||||
|
description: "Common Log Format"
|
||||||
|
- value: "json"
|
||||||
|
description: "JSON"
|
||||||
- variable: middlewares
|
- variable: middlewares
|
||||||
label: ""
|
label: ""
|
||||||
group: "Middlewares"
|
group: "Middlewares"
|
||||||
|
|||||||
@@ -107,17 +107,13 @@ args:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.logs }}
|
{{- with .Values.logs }}
|
||||||
{{- if .general.format }}
|
|
||||||
- "--log.format={{ .general.format }}"
|
- "--log.format={{ .general.format }}"
|
||||||
{{- end }}
|
|
||||||
{{- if ne .general.level "ERROR" }}
|
{{- if ne .general.level "ERROR" }}
|
||||||
- "--log.level={{ .general.level | upper }}"
|
- "--log.level={{ .general.level | upper }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .access.enabled }}
|
{{- if .access.enabled }}
|
||||||
- "--accesslog=true"
|
- "--accesslog=true"
|
||||||
{{- if .access.format }}
|
|
||||||
- "--accesslog.format={{ .access.format }}"
|
- "--accesslog.format={{ .access.format }}"
|
||||||
{{- end }}
|
|
||||||
{{- if .access.bufferingsize }}
|
{{- if .access.bufferingsize }}
|
||||||
- "--accesslog.bufferingsize={{ .access.bufferingsize }}"
|
- "--accesslog.bufferingsize={{ .access.bufferingsize }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -57,18 +57,13 @@ providers:
|
|||||||
logs:
|
logs:
|
||||||
# Traefik logs concern everything that happens to Traefik itself (startup, configuration, events, shutdown, and so on).
|
# Traefik logs concern everything that happens to Traefik itself (startup, configuration, events, shutdown, and so on).
|
||||||
general:
|
general:
|
||||||
# By default, the logs use a text format (common), but you can
|
|
||||||
# also ask for the json format in the format option
|
|
||||||
# format: json
|
|
||||||
# By default, the level is set to ERROR. Alternative logging levels are DEBUG, PANIC, FATAL, ERROR, WARN, and INFO.
|
# By default, the level is set to ERROR. Alternative logging levels are DEBUG, PANIC, FATAL, ERROR, WARN, and INFO.
|
||||||
level: ERROR
|
level: ERROR
|
||||||
|
# -- Set the format of General Logs to be either Common Log Format or JSON. For more information: https://doc.traefik.io/traefik/observability/logs/#format
|
||||||
|
format: common
|
||||||
access:
|
access:
|
||||||
# To enable access logs
|
# To enable access logs
|
||||||
enabled: false
|
enabled: false
|
||||||
# By default, logs are written using the Common Log Format (CLF).
|
|
||||||
# To write logs in JSON, use json in the format option.
|
|
||||||
# If the given format is unsupported, the default (CLF) is used instead.
|
|
||||||
# format: json
|
|
||||||
# To write the logs in an asynchronous fashion, specify a bufferingSize option.
|
# To write the logs in an asynchronous fashion, specify a bufferingSize option.
|
||||||
# This option represents the number of log lines Traefik will keep in memory before writing
|
# This option represents the number of log lines Traefik will keep in memory before writing
|
||||||
# them to the selected output. In some cases, this option can greatly help performances.
|
# them to the selected output. In some cases, this option can greatly help performances.
|
||||||
@@ -93,6 +88,8 @@ logs:
|
|||||||
# User-Agent: redact
|
# User-Agent: redact
|
||||||
# Authorization: drop
|
# Authorization: drop
|
||||||
# Content-Type: keep
|
# Content-Type: keep
|
||||||
|
# -- Set the format of Access Logs to be either Common Log Format or JSON. For more information: https://doc.traefik.io/traefik/observability/access-logs/#format
|
||||||
|
format: common
|
||||||
|
|
||||||
metrics:
|
metrics:
|
||||||
# datadog:
|
# datadog:
|
||||||
|
|||||||
Reference in New Issue
Block a user