File tree 2 files changed +6
-1
lines changed
rootfs/etc/nginx/template
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,10 @@ type Configuration struct {
175
175
// Default: 4 8k
176
176
LargeClientHeaderBuffers string `json:"large-client-header-buffers"`
177
177
178
+ // Enable json escaping
179
+ // http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format
180
+ LogFormatEscapeJson bool `json:"log-format-escape-json,omitempty"`
181
+
178
182
// Customize upstream log_format
179
183
// http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format
180
184
LogFormatUpstream string `json:"log-format-upstream,omitempty"`
@@ -311,6 +315,7 @@ func NewDefault() Configuration {
311
315
KeepAlive : 75 ,
312
316
KeepAliveRequests : 100 ,
313
317
LargeClientHeaderBuffers : "4 8k" ,
318
+ LogFormatEscapeJson : false ,
314
319
LogFormatStream : logFormatStream ,
315
320
LogFormatUpstream : logFormatUpstream ,
316
321
MaxWorkerConnections : 16384 ,
Original file line number Diff line number Diff line change 93
93
# disable warnings
94
94
uninitialized_variable_warn off;
95
95
96
- log_format upstreaminfo '{{ buildLogFormatUpstream $cfg }}';
96
+ log_format upstreaminfo {{ if $cfg.LogFormatEscapeJson }}escape=json {{ end }} '{{ buildLogFormatUpstream $cfg }}';
97
97
98
98
{{/* map urls that should not appear in access.log */}}
99
99
{{/* http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log */}}
You can’t perform that action at this time.
0 commit comments