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

Paolo Bonzini posted 1 patch 23 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/patchew next tags/patchew/20190315162001.27525-1-pbonzini@redhat.com
patchew/settings.py | 9 +++++++++
1 file changed, 9 insertions(+)

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

Posted by Paolo Bonzini 23 weeks ago
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@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

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel

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

Posted by Fam Zheng 22 weeks ago
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@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@euphon.net>


_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel