Statistics
| Branch: | Tag: | Revision:

root / snf-webproject / synnefo / webproject / settings / default / logging.py @ 49026a89

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
    },
43

    
44
    'loggers': {
45
        '': {
46
            'handlers': ['console'],
47
            'level': 'INFO'
48
        },
49
        'synnefo': {
50
            'handlers': ['console'],
51
            'level': 'INFO',
52
            'propagate': 0
53
        },
54
    }
55
}
56

    
57
LOGGING_SETUP['loggers']['synnefo.admin'] = {'level': 'INFO', 'propagate': 1}
58
LOGGING_SETUP['loggers']['synnefo.api'] = {'level': 'INFO', 'propagate': 1}
59
LOGGING_SETUP['loggers']['synnefo.db'] = {'level': 'INFO', 'propagate': 1}
60
LOGGING_SETUP['loggers']['synnefo.logic'] = {'level': 'INFO', 'propagate': 1}
61

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

    
65
SNF_MANAGE_LOGGING_SETUP = {
66
    'version': 1,
67
    'disable_existing_loggers': True,
68

    
69
    'formatters': FORMATTERS,
70

    
71
    'handlers': {
72
        'console': {
73
            'class': 'logging.StreamHandler',
74
            'formatter': 'verbose'
75
        },
76
    },
77

    
78
    'loggers': {
79
        '': {
80
                'handlers': ['console'],
81
                'level': 'WARNING'
82
            },
83
    }
84
}
85

    
86
SNF_MANAGE_LOGGING_SETUP['loggers']['synnefo'] = {'handlers': ['console'],
87
                                                  'level': 'WARNING',
88
                                                  'propagate': 0}