This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 284
/
Copy pathloggingconfig.py
125 lines (124 loc) · 4.07 KB
/
loggingconfig.py
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Golem logging configuration file.
# If you want to modify it locally the preferred way to do this is to create
# loggingconfig_local.py and overwrite LOGGING dict. Typical use case is:
# from loggingconfig import LOGGING
# LOGGING['handlers']['console']['level'] = 'DEBUG'
# LOGGING['root']['level'] = 'DEBUG'
# or
# LOGGING['handlers']['console']['level'] = 'DEBUG'
# LOGGING['loggers']['golem.task.taskmanager'] = {
# 'level': 'DEBUG',
# 'propagate': False,
# 'handlers': ['console',],
# }
LOGGING = {
'version': 1,
# False is required for golem.tools.assertlogs
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': '%(levelname)-8s [%(name)-35s] %(message)s',
},
'date': {
'format': '%(asctime)s %(levelname)-8s %(name)-35s %(message)s',
'datefmt': '%Y-%m-%d %H:%M:%S',
},
},
'filters': {
'sentry-metrics': {
'()': 'golem.tools.customloggers.SentryMetricsFilter'
}
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'level': 'INFO',
'formatter': 'simple',
'filters': [],
'stream': 'ext://sys.stderr',
},
'file': {
'class': 'logging.handlers.TimedRotatingFileHandler',
'level': 'INFO',
'formatter': 'date',
# suffix is substituted in golem.core.common.config_logging()
'filename': '%(logdir)s/golem%(suffix)s.log',
'when': 'D',
'interval': 1,
'backupCount': 5,
'encoding': 'utf-8',
},
'error-file': {
'class': 'logging.FileHandler',
'level': 'WARNING',
'formatter': 'date',
# suffix is substituted in golem.core.common.config_logging()
'filename': '%(logdir)s/golem%(suffix)s.error.log',
'encoding': 'utf-8',
},
'sentry': {
'level': 'ERROR',
'class': 'golem.tools.customloggers.SwitchedSentryHandler',
'dsn': 'https://cdf4218c9dd24aa6adeb76ad0c990c9b:e6922bfaff9f49ccaa22ae4e406354aa@talkback.golem.network/2', # noqa pylint: disable=line-too-long
'ignore_exceptions': ['SystemExit', 'Exit'],
},
'sentry-metrics': {
'level': 'DEBUG',
'class': 'golem.tools.customloggers.SwitchedSentryHandler',
'filters': ['sentry-metrics'],
'dsn': 'https://d0e50b89f1ef4794a4b7f82b06fbe1e7:1043fecec0db4b818ccf76eb03003d03@talkback.golem.network/5', # noqa pylint: disable=line-too-long
'ignore_exceptions': ['SystemExit', 'Exit'],
},
},
'root': {
'level': 'WARNING',
'handlers': ['console', 'file', 'error-file', 'sentry', 'sentry-metrics'], # noqa pylint: disable=line-too-long
'filters': [],
},
'loggers': {
'golemapp': {
'level': 'INFO',
'propagate': True,
},
'golem': {
'level': 'INFO',
'propagate': True,
},
'golem.rpc.crossbar': {
'level': 'INFO',
'propagate': True,
},
'golem_sci': {
'level': 'INFO',
'propagate': True,
},
'transitions': {
'level': 'WARNING',
'propagate': True,
},
'twisted': {
'level': 'WARNING',
'propagate': True,
},
'golem.network': {'propagate': True},
'golem.network.concent.received_handler': {'propagate': True},
'golem.network.transport': {'propagate': True},
'golem.network.transport.session': {
'level': 'WARNING',
'propagate': True,
},
'golem.network.transport.tcpserver': {
'level': 'WARNING',
'propagate': True,
},
'apps': {
'level': 'DEBUG',
'propagate': True,
},
'test': {
'level': 'DEBUG',
'propagate': False,
'handlers': ['console', 'file', ],
},
},
}