Store Log of errors and debug for django

1

I hope you can help me, I am using this code to store the log of my application with django 1.10 but I continue to generate the log of a large size (more than 200mb and increasing), I would like to know how to make it to generate a more small and and if it is possible that it is overwritten, and if it is possible to put in one file the DEBUG and in another the ERROR. Thanks.

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(levelname)s %(message)s'
        },
    },
    'handlers': {
        'file': {
            'level': 'DEBUG',
            'class': 'logging.handlers.RotatingFileHandler',
            'filename': '/home/elros/logs/debug.log',
        'maxBytes': 1024*1024*16,
        'formatter': 'verbose'
        },
    },
    'loggers': {
        'django': {
            'handlers': ['file'],
            'level': 'DEBUG',
            'propagate': True,
        },
    },
}
    
asked by Elros Romeo 24.10.2016 в 16:10
source

1 answer

-1

It seems that your problem is solved using the option

python manage.py runserver --noreload

As recommended here and here

It is a thread problem and it seems that the development server does not agree to stop / continue writing in the file.

    
answered by 24.10.2016 в 16:24