Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(735)

Unified Diff: plaso/multi_processing/task_engine.py

Issue 331400043: [plaso] Added CompressedFileHandler for logging #1549 (Closed)
Patch Set: Changes after review and merge Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « plaso/multi_processing/engine.py ('k') | plaso/multi_processing/worker_process.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: plaso/multi_processing/task_engine.py
diff --git a/plaso/multi_processing/task_engine.py b/plaso/multi_processing/task_engine.py
index e9577480b6057c8c8bba36dd99d367ce6e77f0fa..b2c3646b213ba4e1f2a54e73196845bd991399b4 100644
--- a/plaso/multi_processing/task_engine.py
+++ b/plaso/multi_processing/task_engine.py
@@ -20,6 +20,7 @@ from plaso.engine import profiler
from plaso.engine import zeromq_queue
from plaso.lib import definitions
from plaso.lib import errors
+from plaso.lib import loggers
from plaso.multi_processing import engine
from plaso.multi_processing import multi_process_queue
from plaso.multi_processing import task_manager
@@ -479,8 +480,18 @@ class TaskMultiProcessEngine(engine.MultiProcessEngine):
self._session_identifier, self._processing_configuration,
enable_sigsegv_handler=self._enable_sigsegv_handler, name=process_name)
+ # Remove all possible log handlers to prevent a child process from logging
+ # to the main process log file and garbling the log. The log handlers are
+ # recreated after the worker process has been started.
+ for handler in logging.root.handlers:
+ logging.root.removeHandler(handler)
+
process.start()
+ loggers.ConfigureLogging(
+ debug_output=self._debug_output, filename=self._log_filename,
+ mode='a', quiet_mode=self._quiet_mode)
+
try:
self._StartMonitoringProcess(process)
@@ -758,7 +769,9 @@ class TaskMultiProcessEngine(engine.MultiProcessEngine):
# Keep track of certain values so we can spawn new extraction workers.
self._processing_configuration = processing_configuration
+ self._debug_output = processing_configuration.debug_output
self._filter_find_specs = filter_find_specs
+ self._log_filename = processing_configuration.log_filename
self._session_identifier = session_identifier
self._status_update_callback = status_update_callback
self._storage_writer = storage_writer
« no previous file with comments | « plaso/multi_processing/engine.py ('k') | plaso/multi_processing/worker_process.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b