Skip to content

Commit

Permalink
pass on logger with env control
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-rs committed Sep 27, 2021
1 parent 51caf2b commit 450fc47
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions suricata_/update_server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import tempfile
import time
import logging

from assemblyline_client import get_client
from assemblyline.common import log as al_log, forge
Expand All @@ -10,7 +11,8 @@

from suricata_.suricata_importer import SuricataImporter

al_log.init_logging('updater.suricata')
al_log.init_logging('updater.suricata', log_level=os.environ.get('LOG_LEVEL', "WARNING"))
LOGGER = logging.getLogger('assemblyline.updater.suricata')
classification = forge.get_classification()

UPDATE_CONFIGURATION_PATH = os.environ.get('UPDATE_CONFIGURATION_PATH', "/tmp/suricata_updater_config.yaml")
Expand Down Expand Up @@ -89,5 +91,5 @@ def do_source_update(self, service: Service) -> None:


if __name__ == '__main__':
with SuricataUpdateServer() as server:
with SuricataUpdateServer(logger=LOGGER) as server:
server.serve_forever()

0 comments on commit 450fc47

Please sign in to comment.