Statistics
| Branch: | Tag: | Revision:

root / snf-webproject / synnefo / webproject / settings / default / logging.py @ 0fa71fcc

History | View | Annotate | Download (2.3 kB)

1
# -*- coding: utf-8 -*-
2
#
3
# Logging configuration
4
##################################
5

    
6

    
7
FORMATTERS = {
8
    'simple': {
9
        'format': '%(asctime)s [%(levelname)s] %(message)s'
10
    },
11
    'verbose': {
12
        'format': '%(asctime)s [%(process)d] %(name)s %(module)s [%(levelname)s] %(message)s'
13
    },
14
    'django': {
15
        'format': '[%(asctime)s] %(levelname)s %(message)s',
16
        'datefmt': '%d/%b/%Y %H:%M:%S'
17
    },
18
}
19

    
20

    
21
LOGGING_SETUP = {
22
    'version': 1,
23
    'disable_existing_loggers': False,
24

    
25
    'formatters':  FORMATTERS,
26
    'handlers': {
27
        'null': {
28
            'class': 'logging.NullHandler',
29
        },
30
        'console': {
31
            'class': 'logging.StreamHandler',
32
            'formatter': 'verbose'
33
        },
34
        'syslog': {
35
            'class': 'logging.handlers.SysLogHandler',
36
            'address': '/dev/log',
37
            # 'address': ('localhost', 514),
38
            'facility': 'daemon',
39
            'formatter': 'verbose',
40
            'level': 'INFO',
41
        },
42
        'mail_admins': {
43
            'level': 'ERROR',
44
            'class': 'django.utils.log.AdminEmailHandler',
45
            'include_html': False,
46
        }
47
    },
48

    
49
    'loggers': {
50
        '': {
51
            'handlers': ['console'],
52
            'level': 'INFO'
53
        },
54
        'django.request': {
55
            'handlers': ['mail_admins'],
56
            'level': 'ERROR',
57
            'propagate': True,
58
        },
59
        'synnefo': {
60
            'handlers': ['console'],
61
            'level': 'INFO',
62
            'propagate': 0
63
        },
64
    }
65
}
66

    
67
#LOGGING_SETUP['loggers']['synnefo.admin'] = {'level': 'INFO', 'propagate': 1}
68
#LOGGING_SETUP['loggers']['synnefo.api'] = {'level': 'INFO', 'propagate': 1}
69
#LOGGING_SETUP['loggers']['synnefo.db'] = {'level': 'INFO', 'propagate': 1}
70
#LOGGING_SETUP['loggers']['synnefo.logic'] = {'level': 'INFO', 'propagate': 1}
71

    
72
# To set logging level for plankton to DEBUG just uncomment the follow line:
73
# LOGGING_SETUP['loggers']['synnefo.plankton'] = {'level': 'INFO', 'propagate': 1}
74

    
75
SNF_MANAGE_LOGGING_SETUP = {
76
    'version': 1,
77
    'disable_existing_loggers': False,
78

    
79
    'formatters': FORMATTERS,
80

    
81
    'handlers': {
82
        'console': {
83
            'class': 'logging.StreamHandler',
84
            'formatter': 'verbose'
85
        },
86
    },
87

    
88
    'loggers': {
89
        '': {
90
            'handlers': ['console'],
91
            'level': 'WARNING'
92
        },
93
    }
94
}