Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more control over log_format config directive #2197

Merged
merged 5 commits into from Feb 10, 2024

Conversation

darh
Copy link
Contributor

@darh darh commented Mar 20, 2023

#2133

Introduces 3 new environmental variables:

  • LOG_FORMAT
  • LOG_FORMAT_ESCAPE
  • LOG_JSON

LOG_FORMAT and LOG_FORMAT_ESCAPE default to standard values. When LOG_JSON is set, defaults are changed to: {"time_local":"$time_iso8601","client_ip":"$http_x_forwarded_for","remote_addr":"$remote_addr","request":"$request","status":"$status","body_bytes_sent":"$body_bytes_sent","request_time":"$request_time","upstream_response_time":"$upstream_response_time","upstream_addr":"$upstream_addr","http_referrer":"$http_referer","http_user_agent":"$http_user_agent","request_id":"$request_id"}and json.

See nginx.tmpl and https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format for details

@buchdag buchdag added status/pr-needs-docs This PR needs new or additional documentation type/feat PR for a new feature labels Mar 21, 2023
Introduces 3 new environmental variables:
 - `LOG_FORMAT`
 - `LOG_FORMAT_ESCAPE`
 - `LOG_JSON`

`LOG_FORMAT` and `LOG_FORMAT_ESCAPE` default to standard values.
When `LOG_JSON` is set, defaults are changed to: `{"time_local":"$time_iso8601","client_ip":"$http_x_forwarded_for","remote_addr":"$remote_addr","request":"$request","status":"$status","body_bytes_sent":"$body_bytes_sent","request_time":"$request_time","upstream_response_time":"$upstream_response_time","upstream_addr":"$upstream_addr","http_referrer":"$http_referer","http_user_agent":"$http_user_agent","request_id":"$request_id"}`and `json`.

See `nginx.tmpl` and https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format for details
@buchdag buchdag removed the status/pr-needs-docs This PR needs new or additional documentation label Feb 10, 2024
@buchdag buchdag merged commit f47c874 into nginx-proxy:main Feb 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feat PR for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants