Skip to content

Commit

Permalink
OT-1151: Added log_format for json logging (#245)
Browse files Browse the repository at this point in the history
Co-authored-by: darshan-ht <[email protected]>
  • Loading branch information
ddjain and darshan-ht authored May 21, 2024
1 parent 267f164 commit 81669a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ events {
daemon off;

http {

log_format main escape=json '{"remote_address": "$remote_addr", "remote_user": "$remote_user", "time" : "$time_local", "request": "$request", "status": "$status", "body_bytes_sent": "$body_bytes_sent", "referer": "$http_referer","http_user_agent": "$http_user_agent", "http_x_forwrded_for": "$http_x_forwarded_for"}';

server {
listen 80;
access_log /var/log/nginx/access.log main;
root /usr/share/nginx/html;
include /etc/nginx/mime.types;

Expand Down

0 comments on commit 81669a3

Please sign in to comment.