Skip to content

Commit

Permalink
Merge pull request #265 from phenobarbital/pluggable-logger
Browse files Browse the repository at this point in the history
adding flush timeout to logstash handler
  • Loading branch information
phenobarbital authored Jun 4, 2023
2 parents e9edfa0 + 43f8259 commit 930ac1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions navconfig/logging/handlers/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ class LogstashHandler(AbstractLog):
Send Logs to Logstash using Logstash-async.
"""
def __init__(self, config, loglevel, application: str) -> None:
super(LogstashHandler, self).__init__(config, loglevel, application)
self._flush_timeout = config.getint(
'logstash_flush_timeout', section='logging', fallback=20
)

def formatter(
self,
path: str,
Expand Down Expand Up @@ -41,6 +47,7 @@ def handler(self, enable_localdb: bool = False, **kwargs):
'transport_type': 'tcp',
'host': self.host,
'port': int(self.port),
'flush_timeout': self._flush_timeout, # set the flush_timeout
'level': self.loglevel
}
if enable_localdb is True:
Expand Down
2 changes: 1 addition & 1 deletion navconfig/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__title__ = 'navconfig'
__description__ = ('Configuration tool for all Navigator Services '
'Tool for accessing Config info from different sources.')
__version__ = '1.3.2'
__version__ = '1.3.4'
__author__ = 'Jesus Lara'
__author_email__ = '[email protected]'
__license__ = 'MIT'

0 comments on commit 930ac1d

Please sign in to comment.