File tree 1 file changed +26
-1
lines changed
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -5679,6 +5679,31 @@ to define the log format:
5679
5679
}
5680
5680
}
5681
5681
5682
+ ===============
5683
+ JSON log format
5684
+ ===============
5685
+
5686
+ Starting with NGINX Unit 1.34.0, ` format` can instead be an object describing
5687
+ JSON field name/value pairs, e.g.,
5688
+
5689
+ .. code-block:: json
5690
+
5691
+ {
5692
+ " access_log" : {
5693
+ " path" : " /tmp/access.log" ,
5694
+ " format" : {
5695
+ " remote_addr" : " $remote_addr " ,
5696
+ " time_local" : " $time_local " ,
5697
+ " request_line" : " $request_line " ,
5698
+ " status" : " $status " ,
5699
+ " body_bytes_sent" : " $body_bytes_sent " ,
5700
+ " header_referer" : " $header_referer " ,
5701
+ " header_user_agent" : " $header_user_agent "
5702
+ }
5703
+ }
5704
+ }
5705
+
5706
+ The JSON *values* support being strings, variables and JavaScript.
5682
5707
5683
5708
======================
5684
5709
Conditional access log
@@ -5738,4 +5763,4 @@ Example with njs and the use of a template literal:
5738
5763
" if" : " ` ${uri == ' /health' ? false : true} ` " ,
5739
5764
" path" : " ..."
5740
5765
}
5741
- }
5766
+ }
You can’t perform that action at this time.
0 commit comments