Commit 1aaf6256 authored by Markus Scheidgen's avatar Markus Scheidgen Committed by Lauri Himanen
Browse files

Added a hash of the exception stacktrace to logstash entries. #479

parent e0eb4634
...@@ -47,7 +47,7 @@ from contextlib import contextmanager ...@@ -47,7 +47,7 @@ from contextlib import contextmanager
import json import json
import re import re
from nomad import config from nomad import config, utils
def sanitize_logevent(event: str) -> str: def sanitize_logevent(event: str) -> str:
...@@ -152,6 +152,7 @@ class LogstashFormatter(logstash.formatter.LogstashFormatterBase): ...@@ -152,6 +152,7 @@ class LogstashFormatter(logstash.formatter.LogstashFormatterBase):
continue continue
elif key == 'exception': elif key == 'exception':
message['digest'] = str(value)[-256:] message['digest'] = str(value)[-256:]
message['exception_hash'] = utils.hash(value)
elif key in ['upload_id', 'calc_id', 'mainfile']: elif key in ['upload_id', 'calc_id', 'mainfile']:
key = 'nomad.%s' % key key = 'nomad.%s' % key
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment