From 6548e16baa9823b5d69887cec785cb22f54a4921 Mon Sep 17 00:00:00 2001 From: Dany Marcoux Date: Thu, 17 Oct 2024 21:47:56 +0200 Subject: [PATCH] Add option to disable request logs (#887) Closes #785 --- docs/src/content/docs/options.md | 6 ++++++ uwsgi.ini | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/docs/src/content/docs/options.md b/docs/src/content/docs/options.md index c365ee2c..3938ddf3 100644 --- a/docs/src/content/docs/options.md +++ b/docs/src/content/docs/options.md @@ -268,3 +268,9 @@ When creating HTML archive snapshots, pass additional options to the `single-fil See `single-file --help` for complete list of arguments, or browse source: https://github.com/gildas-lormeau/single-file-cli/blob/master/options.js Example: `LD_SINGLEFILE_OPTIONS=--user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:124.0) Gecko/20100101 Firefox/124.0"` + +### `LD_DISABLE_REQUEST_LOGS` + +Values: `true` or `false` | Default = `false` + +Set uWSGI [disable-logging](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#disable-logging) parameter to disable request logs, except for requests with a client (4xx) or server (5xx) error response. diff --git a/uwsgi.ini b/uwsgi.ini index a8a6eddf..e9f7b9be 100644 --- a/uwsgi.ini +++ b/uwsgi.ini @@ -29,3 +29,9 @@ endif = if-env = LD_LOG_X_FORWARDED_FOR log-x-forwarded-for = %(_) endif = + +if-env = LD_DISABLE_REQUEST_LOGS=true +disable-logging = true +log-4xx = true +log-5xx = true +endif =