Skip to content

Commit

Permalink
charts/*: default logFormat=StructuredJSON format (#2559)
Browse files Browse the repository at this point in the history
* charts/*: default logFormat=StructuredJSON format

This format was introduced in #1951 and #1959.

* Hi CI

* spar: Ensure integration test for testing logging works with StructuredJSON logs

Co-authored-by: Akshay Mankar <[email protected]>
  • Loading branch information
jschaul and akshaymankar authored Jul 14, 2022
1 parent c7cf1a5 commit 986da6f
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 17 deletions.
1 change: 1 addition & 0 deletions changelog.d/2-features/charts-logging
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
charts/wire-server: default log format everywhere to StructuredJSON format (introduced in #1951 and #1959)
3 changes: 1 addition & 2 deletions charts/brig/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ metadata:
data:
{{- with .Values.config }}
brig.yaml: |
logNetStrings: True # log using netstrings encoding:
# http://cr.yp.to/proto/netstrings.txt
logNetStrings: {{ .logNetStrings }}
logFormat: {{ .logFormat }}
logLevel: {{ .logLevel }}
Expand Down
3 changes: 2 additions & 1 deletion charts/brig/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ metrics:
enable: false
config:
logLevel: Info
logFormat: JSON
logFormat: StructuredJSON
logNetStrings: false
cassandra:
host: aws-cassandra
elasticsearch:
Expand Down
3 changes: 2 additions & 1 deletion charts/cannon/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apiVersion: v1
data:
cannon.yaml: |
logFormat: StructuredJSON
logFormat: {{ .Values.config.logFormat }}
logLevel: {{ .Values.config.logLevel }}
logNetStrings: {{ .Values.config.logNetStrings }}
cannon:
host: 0.0.0.0
Expand Down
2 changes: 2 additions & 0 deletions charts/cannon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ nginzImage:
pullPolicy: IfNotPresent
config:
logLevel: Info
logFormat: StructuredJSON
logNetStrings: false

# See also the section 'Controlling the speed of websocket draining during
# cannon pod replacement' in docs/how-to/install/configuration-options.rst
Expand Down
3 changes: 2 additions & 1 deletion charts/cargohold/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: "cargohold"
data:
cargohold.yaml: |
logNetStrings: True # log using netstrings encoding: http://cr.yp.to/proto/netstrings.txt
logFormat: {{ .Values.config.logFormat }}
logLevel: {{ .Values.config.logLevel }}
logNetStrings: {{ .Values.config.logNetStrings }}
cargohold:
host: 0.0.0.0
Expand Down
2 changes: 2 additions & 0 deletions charts/cargohold/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ resources:
cpu: "500m"
config:
logLevel: Info
logFormat: StructuredJSON
logNetStrings: false
enableFederator: false # keep enableFederator default in sync with brig and galley chart's config.enableFederator as well as wire-server chart's tag.federator
aws:
region: "eu-west-1"
Expand Down
3 changes: 1 addition & 2 deletions charts/federator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ data:
{{- with .Values.config }}
logNetStrings: True # log using netstrings encoding:
# http://cr.yp.to/proto/netstrings.txt
logNetStrings: {{ .logNetStrings }}
logFormat: {{ .logFormat }}
logLevel: {{ .logLevel }}
Expand Down
3 changes: 2 additions & 1 deletion charts/federator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ resources:
cpu: "500m"
config:
logLevel: Info
logFormat: JSON
logFormat: StructuredJSON
logNetStrings: false
optSettings:
# Defaults to using system CA store in the federator image for making
# connections to remote federators.
Expand Down
5 changes: 2 additions & 3 deletions charts/galley/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ metadata:
data:
{{- with .Values.config }}
galley.yaml: |
logNetStrings: True # log using netstrings encoding:
# http://cr.yp.to/proto/netstrings.txt
logLevel: {{ .logLevel }}
logFormat: {{ .logFormat }}
logLevel: {{ .logLevel }}
logNetStrings: {{ .logNetStrings }}
galley:
host: 0.0.0.0
Expand Down
3 changes: 2 additions & 1 deletion charts/galley/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ resources:
cpu: "500m"
config:
logLevel: Info
logFormat: JSON
logFormat: StructuredJSON
logNetStrings: false
cassandra:
host: aws-cassandra
replicaCount: 3
Expand Down
3 changes: 2 additions & 1 deletion charts/gundeck/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ metadata:
data:
{{- with .Values.config }}
gundeck.yaml: |
logNetStrings: True # log using netstrings encoding: http://cr.yp.to/proto/netstrings.txt
logFormat: {{ .logFormat }}
logLevel: {{ .logLevel }}
logNetStrings: {{ .logNetStrings }}
gundeck:
host: 0.0.0.0
Expand Down
2 changes: 2 additions & 0 deletions charts/gundeck/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ resources:
cpu: "500m"
config:
logLevel: Info
logFormat: StructuredJSON
logNetStrings: false
cassandra:
host: aws-cassandra
redis:
Expand Down
3 changes: 2 additions & 1 deletion charts/proxy/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: "proxy"
data:
proxy.yaml: |
logNetStrings: True # log using netstrings encoding: http://cr.yp.to/proto/netstrings.txt
logFormat: {{ .Values.config.logFormat }}
logLevel: {{ .Values.config.logLevel }}
logNetStrings: {{ .Values.config.logNetStrings }}
host: 0.0.0.0
port: {{ .Values.service.internalPort }}
Expand Down
4 changes: 3 additions & 1 deletion charts/proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ resources:
memory: "512Mi"
cpu: "500m"
config:
logLevel: Debug
logLevel: Info
logFormat: StructuredJSON
logNetStrings: false
proxy: {}
3 changes: 2 additions & 1 deletion charts/spar/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ metadata:
data:
{{- with .Values.config }}
spar.yaml: |
logNetStrings: True # log using netstrings encoding (see http://cr.yp.to/proto/netstrings.txt)
logFormat: {{ .logFormat }}
logLevel: {{ .logLevel }}
logNetStrings: {{ .logNetStrings }}
brig:
host: brig
Expand Down
2 changes: 2 additions & 0 deletions charts/spar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ config:
richInfoLimit: 5000
maxScimTokens: 0
logLevel: Info
logFormat: StructuredJSON
logNetStrings: false
maxttlAuthreq: 7200
maxttlAuthresp: 7200
proxy: {}
2 changes: 1 addition & 1 deletion services/spar/test-integration/Test/LoggingSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec = describe "logging" $ do
(out, _) <- capture $ do
Log.fatal logger $ Log.msg ("hrgh\n\nwoaa" :: Text)
Log.flush logger
out `shouldContain` "hrgh woaa"
out `shouldContain` "hrgh"
out `shouldNotContain` "hrgh\n\nwoaa"
context "loglevel == debug" $ do
it "400 on finalize-login causes log of entire request" $ do
Expand Down

0 comments on commit 986da6f

Please sign in to comment.