VR: fix logging is not working and logs are not appended to /var/log/cloud.log#4466
Conversation
|
code looks good @weizhouapache . Are we to understand that any modules imported don't get the changed logging config if it is set after importing? |
@DaanHoogland yes. actually all python scripts in /opt/cloud/bin/cs does not have logging settings, so there is no log appended to /var/log/cloud.log |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
pylint doesn't approve of this, @weizhouapache @rhtyd (see 1st travis job) maybe we can mashup the order some more |
| import logging | ||
| logging.basicConfig(filename='/var/log/cloud.log', level=logging.INFO, format='%(asctime)s %(filename)s %(funcName)s:%(lineno)d %(message)s') | ||
|
|
There was a problem hiding this comment.
not really helpfull, maybe. we can solve the pylint issue by tickering the order, something like:
| import logging | |
| logging.basicConfig(filename='/var/log/cloud.log', level=logging.INFO, format='%(asctime)s %(filename)s %(funcName)s:%(lineno)d %(message)s') | |
| import sys | |
| import logging | |
| import subprocess | |
| import os | |
| import os.path | |
| import configure | |
| import json | |
| logging.basicConfig(filename='/var/log/cloud.log', level=logging.INFO, format='%(asctime)s %(filename)s %(funcName)s:%(lineno)d %(message)s') | |
| from subprocess import PIPE, STDOUT |
Maybe with more from x import y's. Or have some option on pylint.
|
Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2397 |
…appended to /var/log/cloud.log" This reverts commit 843a380a923fc91e717440f7af910b3d8933de9f.
@DaanHoogland @rhtyd found another fix, tested ok. please review and test it |
|
@blueorangutan package |
yadvr
left a comment
There was a problem hiding this comment.
Lgtm, but needs checking if we need to specify explicit log file path
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2403 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
great @weizhouapache more elegant and the travis errors so far are unrelated. it's easy to overlook the package init possibility, thanks for this. |
|
Trillian test result (tid-3206)
|
|
marking this as major as it stops operators from being able to do proper diagnosis on the system/network |

Description
There are no logs in /var/log/cloud.log when something are changed in VRs (for example start vms, add/remove rules).
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?