This repository has been archived by the owner on Aug 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenshift.pyconf
100 lines (96 loc) · 3.06 KB
/
openshift.pyconf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import logging
from django.http import UnreadablePostError, Http404
STATIC_URL = '//appmediaserver.appspot.com/media/app/vertaal/%s/' % VERSION
def skip_unreadable_post(record):
if record.exc_info:
exc_type, exc_value = record.exc_info[:2]
if isinstance(exc_value, UnreadablePostError):
return False
return True
def skip_http_not_found(record):
if record.exc_info:
exc_type, exc_value = record.exc_info[:2]
if isinstance(exc_value, Http404):
return False
return True
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '[%(asctime)s %(filename)s %(levelname)s %(module)s (%(lineno)d)] <%(username)s> [%(sessionid)s] %(funcName)s: %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'filters': {
'usercontext': {
'()': 'app.logging.formatter.UserFilter',
},
'skip_unreadable_posts': {
'()': 'django.utils.log.CallbackFilter',
'callback': skip_unreadable_post,
},
'skip_http_not_found': {
'()': 'django.utils.log.CallbackFilter',
'callback': skip_http_not_found,
}
},
'handlers': {
'file': {
'level': logging.DEBUG,
'class': 'app.logging.formatter.ChmodRotatingFileHandler',
'filename': LOG_FILENAME,
'maxBytes': 5242880,
'backupCount': 10,
'formatter': 'verbose',
'filters': ['usercontext']
},
'errorfile': {
'level': logging.ERROR,
'class': 'app.logging.formatter.ChmodRotatingFileHandler',
'filename': ERROR_LOG_FILENAME,
'maxBytes': 5242880,
'backupCount': 10,
'formatter': 'verbose',
'filters': ['usercontext']
},
'batchfile': {
'level': logging.DEBUG,
'class': 'app.logging.formatter.ChmodRotatingFileHandler',
'filename': BATCH_LOG_FILENAME,
'maxBytes': 5242880,
'backupCount': 10,
'formatter': 'verbose',
'filters': ['usercontext']
},
'mail_admins': {
'level': logging.ERROR,
'filters': ['skip_unreadable_posts','skip_http_not_found'],
'class': 'django.utils.log.AdminEmailHandler',
'include_html': False,
}
},
'loggers': {
'vertaal': {
'handlers': ['file', 'errorfile'],
'level': LOG_LEVEL,
'propagate': True,
},
'vertaal.vcs': {
'handlers': ['batchfile'],
'level': LOG_LEVEL,
'propagate': True,
},
'svnclient': {
'handlers': ['batchfile'],
'level': LOG_LEVEL,
'propagate': True,
},
'exceptionlogger': {
'handlers': ['errorfile','mail_admins'],
'level': logging.ERROR,
},
}
}