Commit 3fe3b40b authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Use deployit.logger module to get logger name.

parent 1e2f4210
......@@ -54,7 +54,7 @@ def setup_signal_handler():
signal.signal(signal.SIGINT, _signal_handler)
def setup_syslog_logging(logger_name):
logger = logging.getLogger(logger_name)
syslog_logger = logging.getLogger(logger_name)
syslog_handler = logging.handlers.SysLogHandler(address='/dev/log',
facility='daemon')
......@@ -62,7 +62,7 @@ def setup_syslog_logging(logger_name):
formatter = logging.Formatter('%(name)s: %(message)s')
syslog_handler.setFormatter(formatter)
logger.addHandler(syslog_handler)
syslog_logger .addHandler(syslog_handler)
def main():
global logger, children
......@@ -70,7 +70,7 @@ def main():
arguments = setup_argumentparser().parse_args()
deployit.config.read(arguments.cfgfile)
logger = logging.getLogger('deployitagent')
logger = logging.getLogger(deployit.logging.logger_name)
logger.setLevel(deployit.utils.str_to_loglevel(deployit.config.agent['loglevel']))
if not arguments.foreground:
......@@ -85,9 +85,7 @@ def main():
with open(deployit.config.agent['pidfile'], 'w') as pidfile:
pidfile.write(str(os.getpid()))
setup_syslog_logging('deployitagent')
setup_syslog_logging('deployit')
setup_syslog_logging('managementagent')
setup_syslog_logging(deployit.logging.logger_name)
logger.debug('Going to redirect stdin, stdout, stderr')
dev_null_fd = os.open('/dev/null', os.O_RDWR)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment