From bae80b00a668b678c608d04c1b5d96871a85ece9 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Thu, 11 Jun 2015 13:04:31 +0000 Subject: install: Fix logging setup in server and replica install https://fedorahosted.org/freeipa/ticket/4468 Reviewed-By: Martin Basti --- ipapython/install/cli.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ipapython/install/cli.py b/ipapython/install/cli.py index b526ea753..1ba9a815c 100644 --- a/ipapython/install/cli.py +++ b/ipapython/install/cli.py @@ -10,7 +10,7 @@ import collections import optparse import signal -from ipapython import admintool +from ipapython import admintool, ipa_log_manager from ipapython.ipautil import CheckedIPAddress, private_ccache from . import core, common @@ -256,6 +256,21 @@ class ConfigureTool(admintool.AdminTool): index += 1 + def _setup_logging(self, log_file_mode='w', no_file=False): + if no_file: + log_file_name = None + elif self.options.log_file: + log_file_name = self.options.log_file + else: + log_file_name = self.log_file_name + ipa_log_manager.standard_logging_setup(log_file_name, + debug=self.options.verbose) + self.log = ipa_log_manager.log_mgr.get_logger(self) + if log_file_name: + self.log.debug('Logging to %s' % log_file_name) + elif not no_file: + self.log.debug('Not logging to a file') + def run(self): kwargs = {} -- cgit