Skip to content

Commit

Permalink
[ELASTIC]: Add dynamic LogHandler index
Browse files Browse the repository at this point in the history
  • Loading branch information
amadolid committed Aug 30, 2023
1 parent e568a92 commit 417dc38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions jaseci_core/jaseci/extens/svc/elastic_svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ def post_run(self):
under_test = self.config.get("under_test", False)
if not under_test:
self.configure_elastic()
LOG_QUEUES["core"] = self.add_elastic_log_handler(logger, "core", under_test)
LOG_QUEUES["app"] = self.add_elastic_log_handler(app_logger, "app", under_test)
LOG_QUEUES["core"] = self.add_elastic_log_handler(
logger, self.config.get("core_log_index") or "core", under_test
)
LOG_QUEUES["app"] = self.add_elastic_log_handler(
app_logger, self.config.get("app_log_index") or "app", under_test
)

def configure_elastic(self):
"""
Expand Down
2 changes: 2 additions & 0 deletions jaseci_core/jaseci/jsorc/jsorc_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ class JsOrcSettings:
"auth": os.getenv("ELASTIC_AUTH"),
"common_index": f"{KUBE_NAMESPACE}-common",
"activity_index": f"{KUBE_NAMESPACE}-activity",
"core_log_index": "core",
"app_log_index": "app",
"ilm_policy_name": ELASTIC_ILM_POLICY_NAME,
"ilm_policy": ELASTIC_ILM_POLICY,
"index_template_name": ELASTIC_INDEX_TEMPLATE_NAME,
Expand Down

0 comments on commit 417dc38

Please sign in to comment.