summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Yurtaev <yurtaev@users.noreply.github.com>2016-05-04 21:39:59 +0800
committerEgor Yurtaev <yurtaev@users.noreply.github.com>2016-05-04 21:39:59 +0800
commit4a3f9ec57675bdf796ef2ee599c69283fd423aed (patch)
treeb67998c393e83f74e86434bc9a303f3e11e5afae
parent0958f8edb572b27002cb5841e1abc8d89d917f97 (diff)
parent9df762cf3e1d16e6886013053e51e12641ec1cbb (diff)
downloadomaha-server-4a3f9ec57675bdf796ef2ee599c69283fd423aed.zip
omaha-server-4a3f9ec57675bdf796ef2ee599c69283fd423aed.tar.gz
omaha-server-4a3f9ec57675bdf796ef2ee599c69283fd423aed.tar.bz2
Merge pull request #179 from anmekin/fix/remove_custom_handler
Remove CustomSysLogHandler
-rw-r--r--omaha_server/omaha_server/settings_prod.py2
-rw-r--r--omaha_server/omaha_server/utils.py13
2 files changed, 1 insertions, 14 deletions
diff --git a/omaha_server/omaha_server/settings_prod.py b/omaha_server/omaha_server/settings_prod.py
index 665bd43..d3a3e2e 100644
--- a/omaha_server/omaha_server/settings_prod.py
+++ b/omaha_server/omaha_server/settings_prod.py
@@ -103,7 +103,7 @@ LOGGING = {
if SPLUNK_HOST and SPLUNK_PORT:
LOGGING['handlers']['splunk'] = {
'level': os.environ.get('SPLUNK_LOGGING_LEVEL', 'INFO'),
- 'class': 'omaha_server.utils.CustomSysLogHandler',
+ 'class': 'logging.handlers.SysLogHandler',
'formatter': 'splunk_format',
'address': (SPLUNK_HOST, int(SPLUNK_PORT))
}
diff --git a/omaha_server/omaha_server/utils.py b/omaha_server/omaha_server/utils.py
index cb0422c..59e0a6c 100644
--- a/omaha_server/omaha_server/utils.py
+++ b/omaha_server/omaha_server/utils.py
@@ -26,19 +26,6 @@ class is_private(object):
return inner
-class CustomSysLogHandler(logging.handlers.SysLogHandler):
- def emit(self, record):
- msg = self.format(record) + '\000'
- if type(msg) is unicode:
- msg = msg.encode('utf-8')
- try:
- self.socket.sendto(msg, self.address)
- except (KeyboardInterrupt, SystemExit):
- raise
- except:
- self.handleError(record)
-
-
def show_toolbar(request):
"""
Default function to determine whether to show the toolbar on a given page.