File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,9 +271,25 @@ configs:
271271 done
272272 nginx_conf :
273273 content : |
274+ log_format json_combined escape=json
275+ '{' '"time":"$$time_iso8601"'
276+ ',"request_id":"$$http_x_request_id"'
277+ ',"org_id":"$$http_x_org_id"'
278+ ',"workspace_id":"$$http_x_workspace_id"'
279+ ',"host":"$$host"'
280+ ',"method":"$$request_method"'
281+ ',"uri":"$$uri"'
282+ ',"status":$$status'
283+ ',"request_length":$$request_length'
284+ ',"bytes_sent":$$bytes_sent'
285+ ',"request_time":$$request_time'
286+ ',"upstream_addr":"$$upstream_addr"'
287+ '}';
288+
274289 server {
275290 listen 80 default_server;
276291
292+ access_log /var/log/nginx/access.log json_combined;
277293 client_max_body_size 100m;
278294 client_body_buffer_size 1m;
279295
@@ -308,6 +324,7 @@ configs:
308324 keepalive_timeout 1h;
309325 keepalive_requests 1000000;
310326
327+ access_log /var/log/nginx/access.log json_combined;
311328 client_max_body_size 100m;
312329 client_body_buffer_size 1m;
313330
Original file line number Diff line number Diff line change @@ -301,6 +301,23 @@ configs:
301301 done
302302 nginx_conf :
303303 content : |
304+ log_format json_combined escape=json
305+ '{' '"time":"$$time_iso8601"'
306+ ',"request_id":"$$http_x_request_id"'
307+ ',"org_id":"$$http_x_org_id"'
308+ ',"workspace_id":"$$http_x_workspace_id"'
309+ ',"host":"$$host"'
310+ ',"method":"$$request_method"'
311+ ',"uri":"$$uri"'
312+ ',"status":$$status'
313+ ',"request_length":$$request_length'
314+ ',"bytes_sent":$$bytes_sent'
315+ ',"request_time":$$request_time'
316+ ',"upstream_addr":"$$upstream_addr"'
317+ '}';
318+
319+ access_log /var/log/nginx/access.log json_combined;
320+
304321 proxy_http_version 1.1;
305322 proxy_set_header Host $$host;
306323 proxy_set_header X-Real-IP $$remote_addr;
Original file line number Diff line number Diff line change @@ -910,6 +910,23 @@ configs:
910910 done
911911 nginx_conf :
912912 content : |
913+ log_format json_combined escape=json
914+ '{' '"time":"$$time_iso8601"'
915+ ',"request_id":"$$http_x_request_id"'
916+ ',"org_id":"$$http_x_org_id"'
917+ ',"workspace_id":"$$http_x_workspace_id"'
918+ ',"host":"$$host"'
919+ ',"method":"$$request_method"'
920+ ',"uri":"$$uri"'
921+ ',"status":$$status'
922+ ',"request_length":$$request_length'
923+ ',"bytes_sent":$$bytes_sent'
924+ ',"request_time":$$request_time'
925+ ',"upstream_addr":"$$upstream_addr"'
926+ '}';
927+
928+ access_log /var/log/nginx/access.log json_combined;
929+
913930 # Common proxy settings
914931 proxy_http_version 1.1;
915932 proxy_set_header Host $$host;
You can’t perform that action at this time.
0 commit comments