diff options
author | Adrian Likins <alikins@redhat.com> | 2007-09-25 13:40:56 -0400 |
---|---|---|
committer | Adrian Likins <alikins@redhat.com> | 2007-09-25 13:40:56 -0400 |
commit | 35c3766557793329b9e1ea31b18ea66830367845 (patch) | |
tree | 9de800de57f6950e586b3429909b7d1204f7202b /minion | |
parent | 50c32af5a366bfd5c3a74c468ed47f97684372ab (diff) | |
download | third_party-func-35c3766557793329b9e1ea31b18ea66830367845.tar.gz third_party-func-35c3766557793329b9e1ea31b18ea66830367845.tar.xz third_party-func-35c3766557793329b9e1ea31b18ea66830367845.zip |
fix up logging a bit. I was sending the audit logs and the svc logs
to the same logger before
Diffstat (limited to 'minion')
-rwxr-xr-x | minion/logger.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/minion/logger.py b/minion/logger.py index 1e60dc0..7747824 100755 --- a/minion/logger.py +++ b/minion/logger.py @@ -55,7 +55,8 @@ class Logger(Singleton): self._no_handlers = False -class AuditLogger(Logger): +class AuditLogger(Singleton): + _no_handlers = True def __init__(self, logfilepath = "/var/log/func/audit.log"): self.loglevel = logging.INFO self._setup_logging() @@ -67,6 +68,16 @@ class AuditLogger(Logger): self.logger.info("%s called with %s" % (method, params)) + def _setup_logging(self): + self.logger = logging.getLogger("audit") + + def _setup_handlers(self, logfilepath="/var/log/func/audit.log"): + handler = logging.FileHandler(logfilepath, "a") + self.logger.setLevel(self.loglevel) + formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s") + handler.setFormatter(formatter) + self.logger.addHandler(handler) + self._no_handlers = False |