Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
53caf71d
Commit
53caf71d
authored
Oct 09, 2018
by
Markus Scheidgen
Browse files
Hotfix missing logstash.
parent
217464b5
Pipeline
#37717
passed with stages
in 5 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/processing/base.py
View file @
53caf71d
...
...
@@ -29,6 +29,8 @@ import nomad.patch # pylint: disable=unused-import
if
config
.
logstash
.
enabled
:
utils
.
configure_logging
()
def
initialize_logstash
(
logger
=
None
,
loglevel
=
logging
.
DEBUG
,
**
kwargs
):
utils
.
add_logstash_handler
(
logger
)
return
logger
...
...
nomad/utils.py
View file @
53caf71d
...
...
@@ -98,10 +98,11 @@ class LogstashFormatter(logstash.formatter.LogstashFormatterBase):
def
add_logstash_handler
(
logger
):
has_logstash_handler
=
any
(
isinstance
(
handler
,
logstash
.
TCPLogstashHandler
)
for
handler
in
logger
.
handlers
)
logstash_handler
=
next
((
handler
for
handler
in
logger
.
handlers
if
isinstance
(
handler
,
logstash
.
TCPLogstashHandler
)),
None
)
if
not
has_
logstash_handler
:
if
logstash_handler
is
None
:
logstash_handler
=
logstash
.
TCPLogstashHandler
(
config
.
logstash
.
host
,
config
.
logstash
.
tcp_port
,
version
=
1
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment