From d22c52e00555dc3dc3793fee9169615cb6517710 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Fri, 31 May 2024 15:43:29 +0200 Subject: [PATCH 01/11] added graylog handler --- src/scicat_logging.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scicat_logging.py b/src/scicat_logging.py index ab99800..b0126db 100644 --- a/src/scicat_logging.py +++ b/src/scicat_logging.py @@ -4,6 +4,8 @@ import logging.handlers from datetime import datetime +import graypy + from scicat_configuration import ScicatConfig @@ -33,6 +35,14 @@ def build_logger(config: ScicatConfig) -> logging.Logger: if run_options.system_log: logger.addHandler(logging.handlers.SysLogHandler(address='/dev/log')) + # Add graylog handler + if run_options.graylog: + graylog_handler = graypy.GELFTCPHandler( + run_options.graylog_host, + int(run_options.graylog_port), + facility=run_options.graylog_facility) + logger.addHandler(graylog_handler) + # Set the level and formatter for all handlers logger.setLevel(run_options.log_level) for handler in logger.handlers: From 8fdec804d37690e7b300ee21fef05b2b53115882 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Fri, 31 May 2024 15:48:55 +0200 Subject: [PATCH 02/11] Update scicat_logging.py fixing flake8 linting --- src/scicat_logging.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scicat_logging.py b/src/scicat_logging.py index b0126db..c342be0 100644 --- a/src/scicat_logging.py +++ b/src/scicat_logging.py @@ -40,7 +40,8 @@ def build_logger(config: ScicatConfig) -> logging.Logger: graylog_handler = graypy.GELFTCPHandler( run_options.graylog_host, int(run_options.graylog_port), - facility=run_options.graylog_facility) + facility=run_options.graylog_facility, + ) logger.addHandler(graylog_handler) # Set the level and formatter for all handlers From 32fa6d8ebf887aae8a9949206b5e097b7aa11027 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Fri, 31 May 2024 15:51:31 +0200 Subject: [PATCH 03/11] Update scicat_logging.py fixing linting From 29eb9a5920be3520dbac6494f6e2dea756d2f259 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Fri, 31 May 2024 15:52:59 +0200 Subject: [PATCH 04/11] Update scicat_ingestor.py fixing linting issues --- src/scicat_ingestor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/scicat_ingestor.py b/src/scicat_ingestor.py index 524ea33..886f09b 100644 --- a/src/scicat_ingestor.py +++ b/src/scicat_ingestor.py @@ -68,5 +68,4 @@ def main() -> None: # check if we need to commit the individual message if config.kafka_options.individual_message_commit: - consumer.commit(message=message) - \ No newline at end of file + consumer.commit(message=message) From 2f382bf5dc838dde220eacd3c62962b9f4e80b5e Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Mon, 3 Jun 2024 14:29:18 +0200 Subject: [PATCH 05/11] added graylog conf fields --- resources/config.sample.json | 6 +++++- src/scicat_configuration.py | 4 ++++ src/scicat_ingestor.py | 3 +-- src/scicat_logging.py | 5 +++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/resources/config.sample.json b/resources/config.sample.json index 1ef930f..5b38041 100644 --- a/resources/config.sample.json +++ b/resources/config.sample.json @@ -37,6 +37,10 @@ "system_log_facility" : "mail", "log_message_prefix" : " SFI: ", "check_by_job_id" : true, - "pyscicat": null + "pyscicat": null, + "graylog_log" : false, + "graylog_host" : "", + "graylog_port" : "", + "graylog_facility" : "scicat.ingestor" } } diff --git a/src/scicat_configuration.py b/src/scicat_configuration.py index fe99737..144335f 100644 --- a/src/scicat_configuration.py +++ b/src/scicat_configuration.py @@ -107,6 +107,10 @@ class RunOptions: check_by_job_id: bool system_log_facility: Optional[str] = None pyscicat: Optional[str] = None + graylog_log: bool = False + graylog_host: str = "" + graylog_port: str = "" + graylog_facility: str = "" @dataclass diff --git a/src/scicat_ingestor.py b/src/scicat_ingestor.py index 524ea33..7e96c70 100644 --- a/src/scicat_ingestor.py +++ b/src/scicat_ingestor.py @@ -56,7 +56,6 @@ def main() -> None: # check if we have received a WRDN message # if message is not a WRDN, we get None back if message: - # extract nexus file name from message # extract job id from message @@ -65,8 +64,8 @@ def main() -> None: # instantiate a new process and runs backeground ingestor # on the nexus file + pass # check if we need to commit the individual message if config.kafka_options.individual_message_commit: consumer.commit(message=message) - \ No newline at end of file diff --git a/src/scicat_logging.py b/src/scicat_logging.py index b0126db..e7e7d22 100644 --- a/src/scicat_logging.py +++ b/src/scicat_logging.py @@ -36,11 +36,12 @@ def build_logger(config: ScicatConfig) -> logging.Logger: logger.addHandler(logging.handlers.SysLogHandler(address='/dev/log')) # Add graylog handler - if run_options.graylog: + if run_options.graylog_log: graylog_handler = graypy.GELFTCPHandler( run_options.graylog_host, int(run_options.graylog_port), - facility=run_options.graylog_facility) + facility=run_options.graylog_facility, + ) logger.addHandler(graylog_handler) # Set the level and formatter for all handlers From 3cc7c860d9f653dd44211301c289acdbce1ed9ac Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Mon, 3 Jun 2024 14:43:39 +0200 Subject: [PATCH 06/11] added graypy package --- pyproject.toml | 3 ++- requirements/base.in | 1 + requirements/base.txt | 12 ++++++------ requirements/basetest.txt | 6 +++--- requirements/ci.txt | 10 +++++----- requirements/dev.txt | 18 ++++++++---------- requirements/mypy.txt | 4 ++-- requirements/nightly.in | 1 + requirements/nightly.txt | 12 ++++++------ requirements/static.txt | 15 ++++++--------- 10 files changed, 40 insertions(+), 42 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aed3426..2dda564 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,8 @@ dependencies = [ "confluent_kafka", "ess-streaming-data-types", "requests", - "rich" + "rich", + "graypy" ] dynamic = ["version"] diff --git a/requirements/base.in b/requirements/base.in index b18da2b..14b2fb9 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -7,3 +7,4 @@ confluent_kafka ess-streaming-data-types requests rich +graypy diff --git a/requirements/base.txt b/requirements/base.txt index e072a4b..d70ec2c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -5,17 +5,17 @@ # # pip-compile-multi # -certifi==2024.2.2 +certifi==2024.6.2 # via requests charset-normalizer==3.3.2 # via requests -confluent-kafka==2.3.0 +confluent-kafka==2.4.0 # via -r base.in -ess-streaming-data-types==0.23.1 +ess-streaming-data-types==0.26.1 # via -r base.in flatbuffers==24.3.25 # via ess-streaming-data-types -idna==3.6 +idna==3.7 # via requests kafka-python==2.0.2 # via -r base.in @@ -25,9 +25,9 @@ mdurl==0.1.2 # via markdown-it-py numpy==1.26.4 # via ess-streaming-data-types -pygments==2.17.2 +pygments==2.18.0 # via rich -requests==2.31.0 +requests==2.32.3 # via -r base.in rich==13.7.1 # via -r base.in diff --git a/requirements/basetest.txt b/requirements/basetest.txt index 6eabd7a..aad7976 100644 --- a/requirements/basetest.txt +++ b/requirements/basetest.txt @@ -5,15 +5,15 @@ # # pip-compile-multi # -exceptiongroup==1.2.0 +exceptiongroup==1.2.1 # via pytest iniconfig==2.0.0 # via pytest packaging==24.0 # via pytest -pluggy==1.4.0 +pluggy==1.5.0 # via pytest -pytest==8.1.1 +pytest==8.2.1 # via -r basetest.in tomli==2.0.1 # via pytest diff --git a/requirements/ci.txt b/requirements/ci.txt index 497a73c..e0da602 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -13,7 +13,7 @@ colorama==0.4.6 # via tox distlib==0.3.8 # via virtualenv -filelock==3.13.3 +filelock==3.14.0 # via # tox # virtualenv @@ -26,11 +26,11 @@ packaging==24.0 # -r ci.in # pyproject-api # tox -platformdirs==4.2.0 +platformdirs==4.2.2 # via # tox # virtualenv -pluggy==1.4.0 +pluggy==1.5.0 # via tox pyproject-api==1.6.1 # via tox @@ -40,7 +40,7 @@ tomli==2.0.1 # via # pyproject-api # tox -tox==4.14.2 +tox==4.15.0 # via -r ci.in -virtualenv==20.25.1 +virtualenv==20.26.2 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index ce99385..67fbe09 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,4 @@ -# SHA1:6b332a6c3e0e3001d497bf6635c1625d7e509301 +# SHA1:12be7e8f03b4a9d10aef9113021d5b2636818446 # # This file is autogenerated by pip-compile-multi # To update, run: @@ -10,7 +10,7 @@ -r mypy.txt -r static.txt -r test.txt -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic build==1.2.1 # via pip-tools @@ -20,11 +20,11 @@ click==8.1.7 # pip-tools copier==9.2.0 # via -r dev.in -dunamai==1.19.2 +dunamai==1.21.1 # via copier funcy==2.0 # via copier -jinja2==3.1.3 +jinja2==3.1.4 # via # copier # jinja2-ansible-filters @@ -38,20 +38,18 @@ pip-compile-multi==2.6.3 # via -r dev.in pip-tools==7.4.1 # via pip-compile-multi -plumbum==1.8.2 +plumbum==1.8.3 # via copier prompt-toolkit==3.0.36 # via questionary -pydantic==2.6.4 +pydantic==2.7.2 # via copier -pydantic-core==2.16.3 +pydantic-core==2.18.3 # via pydantic -pyproject-hooks==1.0.0 +pyproject-hooks==1.1.0 # via # build # pip-tools -pyyaml-include==1.4.1 - # via -r dev.in questionary==2.0.1 # via copier toposort==1.10 diff --git a/requirements/mypy.txt b/requirements/mypy.txt index 8d29307..9732b15 100644 --- a/requirements/mypy.txt +++ b/requirements/mypy.txt @@ -6,9 +6,9 @@ # pip-compile-multi # -r test.txt -mypy==1.9.0 +mypy==1.10.0 # via -r mypy.in mypy-extensions==1.0.0 # via mypy -typing-extensions==4.11.0 +typing-extensions==4.12.1 # via mypy diff --git a/requirements/nightly.in b/requirements/nightly.in index 6a10cbf..f36bed9 100644 --- a/requirements/nightly.in +++ b/requirements/nightly.in @@ -6,3 +6,4 @@ confluent_kafka ess-streaming-data-types requests rich +graypy diff --git a/requirements/nightly.txt b/requirements/nightly.txt index 4048d6b..d20cc75 100644 --- a/requirements/nightly.txt +++ b/requirements/nightly.txt @@ -6,17 +6,17 @@ # pip-compile-multi # -r basetest.txt -certifi==2024.2.2 +certifi==2024.6.2 # via requests charset-normalizer==3.3.2 # via requests -confluent-kafka==2.3.0 +confluent-kafka==2.4.0 # via -r nightly.in -ess-streaming-data-types==0.23.1 +ess-streaming-data-types==0.26.1 # via -r nightly.in flatbuffers==24.3.25 # via ess-streaming-data-types -idna==3.6 +idna==3.7 # via requests kafka-python==2.0.2 # via -r nightly.in @@ -26,9 +26,9 @@ mdurl==0.1.2 # via markdown-it-py numpy==1.26.4 # via ess-streaming-data-types -pygments==2.17.2 +pygments==2.18.0 # via rich -requests==2.31.0 +requests==2.32.3 # via -r nightly.in rich==13.7.1 # via -r nightly.in diff --git a/requirements/static.txt b/requirements/static.txt index bc4d3df..ea619e4 100644 --- a/requirements/static.txt +++ b/requirements/static.txt @@ -9,20 +9,17 @@ cfgv==3.4.0 # via pre-commit distlib==0.3.8 # via virtualenv -filelock==3.13.3 +filelock==3.14.0 # via virtualenv -identify==2.5.35 +identify==2.5.36 # via pre-commit -nodeenv==1.8.0 +nodeenv==1.9.0 # via pre-commit -platformdirs==4.2.0 +platformdirs==4.2.2 # via virtualenv -pre-commit==3.7.0 +pre-commit==3.7.1 # via -r static.in pyyaml==6.0.1 # via pre-commit -virtualenv==20.25.1 +virtualenv==20.26.2 # via pre-commit - -# The following packages are considered to be unsafe in a requirements file: -# setuptools From 56b95223edda0eec36b126e912f2b92d1bb0f119 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Mon, 3 Jun 2024 14:57:30 +0200 Subject: [PATCH 07/11] added graylog input arguments --- src/scicat_configuration.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/scicat_configuration.py b/src/scicat_configuration.py index 144335f..8f21a0b 100644 --- a/src/scicat_configuration.py +++ b/src/scicat_configuration.py @@ -84,6 +84,31 @@ def build_main_arg_parser() -> argparse.ArgumentParser: default=None, type=str, ) + group.add_argument( + '--graylog-log', + dest='graylog_log', + help='Provide logging on a graylog system', + action='store_true', + default=False, + ) + group.add_argument( + '--graylog-host', + dest='graylog_host', + help='Hostname or ip address of the graylog server', + default='', + ) + group.add_argument( + '--graylog-port', + dest='graylog_port', + help='POrt number used to communicate with the graylog server', + default='', + ) + group.add_argument( + '--graylog-facility', + dest='graylog_facility', + help='Facility for graylog logs', + default='scicat.ingestor', + ) return parser From f80a09973764898119e29dd3ca84002d9afdfa95 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Mon, 10 Jun 2024 10:56:43 +0200 Subject: [PATCH 08/11] updated dream configuration example --- resources/dream.configuration.json.example | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 resources/dream.configuration.json.example diff --git a/resources/dream.configuration.json.example b/resources/dream.configuration.json.example new file mode 100644 index 0000000..9943053 --- /dev/null +++ b/resources/dream.configuration.json.example @@ -0,0 +1,55 @@ +{ + "proposal_id" : { + "field_type" : "high_level", + "machine_name" : "proposalId", + "source" : "NXS:/entry/experiment_identifier", + "type" : "string" + }, + "principal_investigator" : { + "field_type" : "high_level", + "machine_name" : "principalInvestigator", + "source" : "UO:proposal:/proposer/firstname + UO:proposal:/proposer/lastname", + "type" : "string" + }, + "dataset_name" : { + "field_type" : "high_level", + "machine_name" : "datasetName", + "source" : "NXS:/entry/title", + "type" : "string" + }, + "techniques" : { + "field_type" : "high_level", + "machine_name" : "techniques", + "human_name" : "techniques", + "value" : "", + "type" : "object" + }, + "start_time" : { + "field_type" : "scientific_metadata", + "machine_name" : "start_time", + "human_name" : "Start Time", + "source" : "WRDN:/metadata/start_time", + "transformation" : "timestamp_to_iso8601", + "type" : "date" + } + "end_time" : { + "field_type" : "scientific_metadata", + "machine_name" : "end_time", + "human_name" : "End Time", + "source" : "WRDN:/metadata/end_time", + "transformation" : "timestamp_to_iso8601", + "type" : "date" + }, + "sample_id" : { + "field_type" : "high_level", + "machine_name" : "sampleId", + "value" : "", + "type" : "string" + }, + "instrument_id" : { + "field_type" : "high_level", + "machine_name" : "instrumentId", + "value" : "DREAM", + "type" : "string" + }, +] \ No newline at end of file From a536f04578095d5a79a318cbe3530793a145ce30 Mon Sep 17 00:00:00 2001 From: YooSunyoung Date: Tue, 11 Jun 2024 15:10:02 +0200 Subject: [PATCH 09/11] Group configurations. --- resources/config.sample.json | 10 ++- src/scicat_configuration.py | 139 ++++++++++++++++------------------- src/scicat_logging.py | 9 ++- 3 files changed, 76 insertions(+), 82 deletions(-) diff --git a/resources/config.sample.json b/resources/config.sample.json index 5b38041..eebed4b 100644 --- a/resources/config.sample.json +++ b/resources/config.sample.json @@ -17,6 +17,11 @@ "username": "USERNAME", "password": "PASSWORD" }, + "graylog": { + "host" : "", + "port" : "", + "facility" : "scicat.ingestor" + }, "dataset": { "instrument_id" : "", "instrument" : "INSTRUMENT_NAME", @@ -38,9 +43,6 @@ "log_message_prefix" : " SFI: ", "check_by_job_id" : true, "pyscicat": null, - "graylog_log" : false, - "graylog_host" : "", - "graylog_port" : "", - "graylog_facility" : "scicat.ingestor" + "graylog" : false } } diff --git a/src/scicat_configuration.py b/src/scicat_configuration.py index 8f21a0b..6673cc9 100644 --- a/src/scicat_configuration.py +++ b/src/scicat_configuration.py @@ -8,110 +8,99 @@ def build_main_arg_parser() -> argparse.ArgumentParser: parser = argparse.ArgumentParser() - group = parser.add_argument_group('Scicat Ingestor Options') + group = parser.add_argument_group("Scicat Ingestor Options") group.add_argument( - '-c', - '--cf', - '--config', - '--config-file', - default='config.20240405.json', - dest='config_file', - help='Configuration file name. Default: config.20240405.json', + "-c", + "--cf", + "--config", + "--config-file", + default="config.20240405.json", + dest="config_file", + help="Configuration file name. Default: config.20240405.json", type=str, ) group.add_argument( - '-v', - '--verbose', - dest='verbose', - help='Provide logging on stdout', - action='store_true', + "-v", + "--verbose", + dest="verbose", + help="Provide logging on stdout", + action="store_true", default=False, ) group.add_argument( - '--file-log', - dest='file_log', - help='Provide logging on file', - action='store_true', + "--file-log", + dest="file_log", + help="Provide logging on file", + action="store_true", default=False, ) group.add_argument( - '--log-filepath-prefix', - dest='log_filepath_prefix', - help='Prefix of the log file path', - default='.scicat_ingestor_log', + "--log-filepath-prefix", + dest="log_filepath_prefix", + help="Prefix of the log file path", + default=".scicat_ingestor_log", ) group.add_argument( - '--file-log-timestamp', - dest='file_log_timestamp', - help='Provide logging on the system log', - action='store_true', + "--file-log-timestamp", + dest="file_log_timestamp", + help="Provide logging on the system log", + action="store_true", default=False, ) group.add_argument( - '--system-log', - dest='system_log', - help='Provide logging on the system log', - action='store_true', + "--system-log", + dest="system_log", + help="Provide logging on the system log", + action="store_true", default=False, ) group.add_argument( - '--system-log-facility', - dest='system_log_facility', - help='Facility for system log', - default='mail', + "--system-log-facility", + dest="system_log_facility", + help="Facility for system log", + default="mail", ) group.add_argument( - '--log-message-prefix', - dest='log_message_prefix', - help='Prefix for log messages', - default=' SFI: ', + "--log-message-prefix", + dest="log_message_prefix", + help="Prefix for log messages", + default=" SFI: ", ) group.add_argument( - '--log-level', dest='log_level', help='Logging level', default='INFO', type=str + "--log-level", dest="log_level", help="Logging level", default="INFO", type=str ) group.add_argument( - '--check-by-job-id', - dest='check_by_job_id', - help='Check the status of a job by job_id', - action='store_true', + "--check-by-job-id", + dest="check_by_job_id", + help="Check the status of a job by job_id", + action="store_true", default=True, ) group.add_argument( - '--pyscicat', - dest='pyscicat', - help='Location where a specific version of pyscicat is available', + "--pyscicat", + dest="pyscicat", + help="Location where a specific version of pyscicat is available", default=None, type=str, ) group.add_argument( - '--graylog-log', - dest='graylog_log', - help='Provide logging on a graylog system', - action='store_true', + "--graylog", + dest="graylog_log", + help="Use graylog for additional logs", + action="store_true", default=False, ) - group.add_argument( - '--graylog-host', - dest='graylog_host', - help='Hostname or ip address of the graylog server', - default='', - ) - group.add_argument( - '--graylog-port', - dest='graylog_port', - help='POrt number used to communicate with the graylog server', - default='', - ) - group.add_argument( - '--graylog-facility', - dest='graylog_facility', - help='Facility for graylog logs', - default='scicat.ingestor', - ) return parser +@dataclass +class GraylogOptions: + host: str = "" + port: str = "" + facility: str = "scicat.ingestor" + + @dataclass class RunOptions: """RunOptions dataclass to store the configuration options. @@ -132,10 +121,7 @@ class RunOptions: check_by_job_id: bool system_log_facility: Optional[str] = None pyscicat: Optional[str] = None - graylog_log: bool = False - graylog_host: str = "" - graylog_port: str = "" - graylog_facility: str = "" + graylog: bool = False @dataclass @@ -168,6 +154,8 @@ class ScicatConfig: """Merged configuration dictionary with command line arguments.""" kafka_options: kafkaOptions """Kafka configuration options read from files.""" + graylog_options: GraylogOptions + """Graylog configuration options for streaming logs.""" def to_dict(self) -> dict: """Return the configuration as a dictionary.""" @@ -179,7 +167,9 @@ def to_dict(self) -> dict: if isinstance(value, Mapping): original_dict[key] = dict(value) - copied = ScicatConfig(original_dict, self.run_options, self.kafka_options) + copied = ScicatConfig( + original_dict, self.run_options, self.kafka_options, self.graylog_options + ) return asdict(copied) @@ -200,7 +190,7 @@ def build_scicat_config(input_args: argparse.Namespace) -> ScicatConfig: config_dict = dict() # Overwrite deep-copied options with command line arguments - run_option_dict: dict = copy.deepcopy(config_dict.setdefault('options', dict())) + run_option_dict: dict = copy.deepcopy(config_dict.setdefault("options", dict())) for arg_name, arg_value in vars(input_args).items(): if arg_value is not None: run_option_dict[arg_name] = arg_value @@ -213,5 +203,6 @@ def build_scicat_config(input_args: argparse.Namespace) -> ScicatConfig: return ScicatConfig( original_dict=MappingProxyType(config_dict), run_options=RunOptions(**run_option_dict), - kafka_options=kafkaOptions(**config_dict.setdefault('kafka', dict())), + kafka_options=kafkaOptions(**config_dict.setdefault("kafka", dict())), + graylog_options=GraylogOptions(**config_dict.setdefault("graylog", dict())), ) diff --git a/src/scicat_logging.py b/src/scicat_logging.py index e7e7d22..2017fe0 100644 --- a/src/scicat_logging.py +++ b/src/scicat_logging.py @@ -36,11 +36,12 @@ def build_logger(config: ScicatConfig) -> logging.Logger: logger.addHandler(logging.handlers.SysLogHandler(address='/dev/log')) # Add graylog handler - if run_options.graylog_log: + if run_options.graylog: + graylog_config = config.graylog_options graylog_handler = graypy.GELFTCPHandler( - run_options.graylog_host, - int(run_options.graylog_port), - facility=run_options.graylog_facility, + graylog_config.host, + int(graylog_config.port), + facility=graylog_config.facility, ) logger.addHandler(graylog_handler) From fe1506de7a4c7f6ad4d6830bcb216c9e1788edea Mon Sep 17 00:00:00 2001 From: YooSunyoung Date: Tue, 11 Jun 2024 16:30:00 +0200 Subject: [PATCH 10/11] Fix typo. --- src/scicat_configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scicat_configuration.py b/src/scicat_configuration.py index 6673cc9..d4413e3 100644 --- a/src/scicat_configuration.py +++ b/src/scicat_configuration.py @@ -86,7 +86,7 @@ def build_main_arg_parser() -> argparse.ArgumentParser: ) group.add_argument( "--graylog", - dest="graylog_log", + dest="graylog", help="Use graylog for additional logs", action="store_true", default=False, From 7f66b4e2651c5ea1b51675c53c9606a4bf075459 Mon Sep 17 00:00:00 2001 From: YooSunyoung Date: Tue, 11 Jun 2024 16:30:20 +0200 Subject: [PATCH 11/11] Fix configuration. --- tests/test_logging.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_logging.py b/tests/test_logging.py index daf3f2e..b89129f 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -2,7 +2,7 @@ import pytest -from scicat_configuration import RunOptions, ScicatConfig, kafkaOptions +from scicat_configuration import GraylogOptions, RunOptions, ScicatConfig, kafkaOptions @pytest.fixture @@ -23,6 +23,7 @@ def scicat_config(tmp_path: pathlib.Path) -> ScicatConfig: pyscicat='test', ), kafka_options=kafkaOptions(), + graylog_options=GraylogOptions(), )