[node-patches] Change in ovirt-node[master]: log: ovirt-node.log replaced by /var/log/messages
dougsland at redhat.com
dougsland at redhat.com
Sat Jun 6 00:22:57 UTC 2015
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: log: ovirt-node.log replaced by /var/log/messages
......................................................................
log: ovirt-node.log replaced by /var/log/messages
oVirt Node provides persist/unpersist module
for node components like VDSM but depending of
user:group of component doesn't have access
to write into /var/log/ovirt-node.log and
fail to start due this limitation.
This patch moves the runtime logs from
/var/log/ovirt-not.log to /var/log/messages
Change-Id: I6ecaa56454d40ee83b91632a57f3d194866531ee
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1224400
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M data/logging.conf
M src/ovirtnode/ovirtfunctions.py
2 files changed, 20 insertions(+), 16 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/07/42007/1
diff --git a/data/logging.conf b/data/logging.conf
index dd351fd..15c7b2e 100644
--- a/data/logging.conf
+++ b/data/logging.conf
@@ -6,19 +6,20 @@
keys=root
[handlers]
-keys=file,stderr
+keys=syslog,stderr
[formatters]
-keys=simple
+keys=simple,sysform
[logger_root]
level=INFO
-handlers=stderr,file
+handlers=syslog, stderr
-[handler_file]
-class=handlers.WatchedFileHandler
-formatter=simple
-args=('/var/log/ovirt-node.log', 'a')
+[handler_syslog]
+level=DEBUG
+class=handlers.SysLogHandler
+formatter=sysform
+args=('/dev/log', handlers.SysLogHandler.LOG_USER)
[handler_stderr]
class=StreamHandler
@@ -27,3 +28,6 @@
[formatter_simple]
format=%(asctime)s %(levelname)10s %(message)s
+
+[formatter_sysform]
+format= ovirt-node %(name)s %(levelname)s %(message)s
diff --git a/src/ovirtnode/ovirtfunctions.py b/src/ovirtnode/ovirtfunctions.py
index 619536e..7c1af56 100644
--- a/src/ovirtnode/ovirtfunctions.py
+++ b/src/ovirtnode/ovirtfunctions.py
@@ -38,6 +38,7 @@
import grp
import pwd
import time
+from ovirt.node import log as ovirtlog
from ovirt.node.config import defaults
from ovirt.node.utils import process, hooks
import ovirt.node.utils.system as osystem
@@ -1853,13 +1854,6 @@
OVIRT_VARS = parse_defaults()
-# setup logging facility
-if is_stateless():
- log_file = OVIRT_LOGFILE
-elif is_firstboot():
- log_file = OVIRT_TMP_LOGFILE
-else:
- log_file = OVIRT_LOGFILE
def setup_custom_logger():
formatter = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(module)s - %(message)s')
@@ -1870,5 +1864,11 @@
logger.addHandler(handler)
return logger
-setup_custom_logger()
-logger = logging.getLogger(PRODUCT_SHORT)
+# setup logging facility
+if is_firstboot():
+ log_file = OVIRT_TMP_LOGFILE
+ setup_custom_logger()
+ logger = logging.getLogger(PRODUCT_SHORT)
+else:
+ ovirtlog.configure_logging()
+ logger = ovirtlog.getLogger()
--
To view, visit https://gerrit.ovirt.org/42007
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ecaa56454d40ee83b91632a57f3d194866531ee
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
More information about the node-patches
mailing list