[Patchew-devel] [PATCH] settings: disable template logs

Fam Zheng fam at euphon.net
Sun Mar 17 02:59:19 UTC 2019


On Fri, 03/15 17:20, Paolo Bonzini wrote:
> Template logs are consuming gigabytes of disk on both patchew.org
> and next.patchew.org because of VariableDoesNotExist errors.
> 
> Disable them since they are harmless.
> 
> Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
> ---
>  patchew/settings.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/patchew/settings.py b/patchew/settings.py
> index 773ff0e..11a79b4 100644
> --- a/patchew/settings.py
> +++ b/patchew/settings.py
> @@ -218,6 +218,10 @@ if not DEBUG:
>                  'class': 'logging.FileHandler',
>                  'filename': os.path.join(DATA_DIR, "log", "patchew.log"),
>              },
> +            'null': {
> +                'level': 'DEBUG',
> +                'class': 'logging.NullHandler',
> +            },
>          },
>          'loggers': {
>              'django': {
> @@ -225,5 +229,10 @@ if not DEBUG:
>                  'level': 'DEBUG',
>                  'propagate': True,
>              },
> +            'django.template': {
> +                'handlers': ['null'],  # Quiet by default!
> +                'propagate': False,
> +                'level': 'DEBUG',
> +            },
>          },
>      }
> -- 
> 2.20.1

Reviewed-by: Fam Zheng <fam at euphon.net>





More information about the Patchew-devel mailing list