$ ryu-manager --log_file $HOME/ryu.log Traceback (most recent call last): (...) File "/usr/local/lib/python2.7/dist-packages/ryu-1.1-py2.7.egg/ryu/log.py", line 74, in init_log logging.addHandler(logging.handlers.WatchedFileHandler(log_file)) AttributeError: 'module' object has no attribute 'addHandler'
$ ryu-manager --log_file $HOME/ryu.log Traceback (most recent call last): (...) File "/usr/local/lib/python2.7/dist-packages/ryu-1.4-py2.7.egg/ryu/log.py", line 74, in init_log log.addHandler(logging.handlers.WatchedFileHandler(log_file)) AttributeError: 'module' object has no attribute 'handlers' $ ryu-manager --log_file $HOME/ryu.log Traceback (most recent call last): (...) File "/usr/local/lib/python2.7/dist-packages/ryu-1.4-py2.7.egg/ryu/log.py", line 76, in init_log mode = int(FLAGS.log_file_mnode, 8) File "/usr/local/lib/python2.7/dist-packages/gflags.py", line 810, in __getattr__ raise AttributeError(name) AttributeError: log_file_mnode $ ryu-manager --log_dir $HOME/log/ Traceback (most recent call last): (...) File "/usr/local/lib/python2.7/dist-packages/ryu-1.4-py2.7.egg/ryu/log.py", line 54, in _get_log_file return os.path.join(FLAGS.logdir, File "/usr/local/lib/python2.7/dist-packages/gflags.py", line 810, in __getattr__ raise AttributeError(name) AttributeError: logdir Signed-off-by: YAMADA Hideki <yamada.hid...@po.ntts.co.jp> --- ryu/log.py | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ryu/log.py b/ryu/log.py index 0125894..ef1b1cb 100644 --- a/ryu/log.py +++ b/ryu/log.py @@ -17,6 +17,7 @@ import gflags import inspect import logging +import logging.handlers import os import sys @@ -50,7 +51,7 @@ def _get_log_file(): if FLAGS.log_file: return FLAGS.log_file if FLAGS.log_dir: - return os.path.join(FLAGS.logdir, + return os.path.join(FLAGS.log_dir, os.path.basename(inspect.stack()[-1][1])) + '.log' return None @@ -71,8 +72,8 @@ def init_log(): log_file = _get_log_file() if log_file is not None: - logging.addHandler(logging.handlers.WatchedFileHandler(log_file)) - mode = int(FLAGS.log_file_mnode, 8) + log.addHandler(logging.handlers.WatchedFileHandler(log_file)) + mode = int(FLAGS.log_file_mode, 8) os.chmod(log_file, mode) if FLAGS.verbose: -- 1.7.1 ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel