So we account for the case where we can't figure out the server log dir by relative positioning.
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> --- client/common_lib/logging_config.py | 9 ++++++++- global_config.ini | 3 +++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/client/common_lib/logging_config.py b/client/common_lib/logging_config.py index 6f299f1..cad5936 100644 --- a/client/common_lib/logging_config.py +++ b/client/common_lib/logging_config.py @@ -1,4 +1,7 @@ import logging, os, sys, time +from autotest_lib.client.common_lib import global_config + +GLOBAL_CONFIG = global_config.global_config # set up a simple catchall configuration for use during import time. some code # may log messages at import time and we don't want those to get completely @@ -51,7 +54,11 @@ class LoggingConfig(object): @classmethod def get_server_log_dir(cls): - return os.path.join(cls.get_autotest_root(), 'logs') + server_log_dir = GLOBAL_CONFIG.get_config_value('SERVER', + 'logs_dir', default='') + if not server_log_dir: + server_log_dir = os.path.join(cls.get_autotest_root(), 'logs') + return server_log_dir def add_stream_handler(self, stream, level=logging.DEBUG): diff --git a/global_config.ini b/global_config.ini index fbc8a82..df14f26 100644 --- a/global_config.ini +++ b/global_config.ini @@ -93,6 +93,9 @@ smtp_password: # Time in hours to wait before giving up on crash collection. A timeout of 0 # means crash collection is skipped unless the host is already available. crash_collection_hours_to_wait: 4.0 +# Specify a location to store the server log files +#logs_dir: /var/log/autotest +logs_dir: [SCHEDULER] # Whether to enable scheduler. -- 1.7.7.6 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
