Merge lp:~allenap/maas/lies-damn-lies-and-logging into lp:~maas-committers/maas/trunk

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 3817
Proposed branch: lp:~allenap/maas/lies-damn-lies-and-logging
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 90 lines (+16/-23)
4 files modified
contrib/maas-rsyslog.conf (+1/-1)
src/maas/settings.py (+10/-20)
src/provisioningserver/logger/log.py (+4/-1)
src/provisioningserver/tests/test_tags.py (+1/-1)
To merge this branch: bzr merge lp:~allenap/maas/lies-damn-lies-and-logging
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+247013@code.launchpad.net

Commit message

Filter syslog tags for 'maas' more carefully, don't clobber the 'maas' logger, and don't propagate messages from the 'maas' logger.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (88.8 KiB)

The attempt to merge lp:~allenap/maas/lies-damn-lies-and-logging into lp:maas failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Get:2 http://security.ubuntu.com trusty-security Release [63.5 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates Release [63.5 kB]
Get:5 http://security.ubuntu.com trusty-security/main Sources [78.5 kB]
Get:6 http://security.ubuntu.com trusty-security/universe Sources [19.5 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [258 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Get:8 http://security.ubuntu.com trusty-security/universe amd64 Packages [92.5 kB]
Get:9 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [192 kB]
Get:10 http://security.ubuntu.com trusty-security/main Translation-en [131 kB]
Get:11 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [108 kB]
Get:12 http://security.ubuntu.com trusty-security/universe Translation-en [51.4 kB]
Get:13 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [497 kB]
Get:14 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [263 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Fetched 1,820 kB in 3s (557 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 authbind bind9 bind9utils build-essential bzr-builddeb chromium-browser chromium-chromedriver curl daemontools debhelper dh-apport dh-systemd distro-info dnsutils firefox freeipmi-tools gjs ipython isc-dhcp-common libjs-angularjs libjs-jquery libjs-jquery-hotkeys libjs-yui3-full libjs-yui3-min libpq-dev make nodejs-legacy npm pep8 postgresql pyflakes python-apt python-bson python-bzrlib python-convoy python-coverage python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-extras python-fixtures python-flake8 python-formencode python-hivex python-httplib2 python-iscpy python-jinja2 python-jsonschema python-lockfile python-lxml python-mock python-netaddr py...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'contrib/maas-rsyslog.conf'
--- contrib/maas-rsyslog.conf 2014-07-29 10:38:32 +0000
+++ contrib/maas-rsyslog.conf 2015-04-14 14:38:55 +0000
@@ -1,2 +1,2 @@
1# Log MAAS messages to their own file.1# Log MAAS messages to their own file.
2:syslogtag,contains,"maas" /var/log/maas/maas.log2:syslogtag,regex,"^maas\b$" /var/log/maas/maas.log
33
=== modified file 'src/maas/settings.py'
--- src/maas/settings.py 2015-03-30 08:26:36 +0000
+++ src/maas/settings.py 2015-04-14 14:38:55 +0000
@@ -260,8 +260,13 @@
260 'django.contrib.admin',260 'django.contrib.admin',
261 )261 )
262262
263# See http://docs.djangoproject.com/en/dev/topics/logging for263# See http://docs.djangoproject.com/en/dev/topics/logging for more details on
264# more details on how to customize the logging configuration.264# how to customize the logging configuration.
265#
266# NOTE CAREFULLY that django.utils.log.DEFAULT_LOGGING is applied *before*
267# applying the configuration below. This means that you need to mentally
268# combine the settings in both DEFAULT_LOGGING and LOGGING to understand the
269# resultant behaviour.
265LOGGING = {270LOGGING = {
266 'version': 1,271 'version': 1,
267 'disable_existing_loggers': False,272 'disable_existing_loggers': False,
@@ -280,26 +285,11 @@
280 },285 },
281 'root': {286 'root': {
282 'handlers': ['stdout'],287 'handlers': ['stdout'],
288 'level': DEFAULT_LOG_LEVEL,
283 },289 },
290 # Do *not* set any options for the `maas` logger here because config done
291 # elsewhere -- by configure_root_logger() -- will be clobbered.
284 'loggers': {292 'loggers': {
285 'maas': {
286 'level': DEFAULT_LOG_LEVEL,
287 },
288 'maasserver': {
289 'level': DEFAULT_LOG_LEVEL,
290 },
291 'metadataserver': {
292 'level': DEFAULT_LOG_LEVEL,
293 },
294 'django.request': {
295 'level': DEFAULT_LOG_LEVEL,
296 },
297 'django.db.backends': {
298 'level': DEFAULT_LOG_LEVEL,
299 },
300 'sstreams': {
301 'level': DEFAULT_LOG_LEVEL,
302 },
303 'urllib3': {293 'urllib3': {
304 'level': 'WARN',294 'level': 'WARN',
305 },295 },
306296
=== modified file 'src/provisioningserver/logger/log.py'
--- src/provisioningserver/logger/log.py 2015-03-04 23:52:02 +0000
+++ src/provisioningserver/logger/log.py 2015-04-14 14:38:55 +0000
@@ -60,11 +60,14 @@
60 root = get_maas_logger()60 root = get_maas_logger()
61 if len(root.handlers) == 0:61 if len(root.handlers) == 0:
62 # It has not yet been configured.62 # It has not yet been configured.
63 handler = SysLogHandler("/dev/log")63 handler = SysLogHandler(
64 "/dev/log", facility=SysLogHandler.LOG_DAEMON)
64 handler.setFormatter(logging.Formatter(65 handler.setFormatter(logging.Formatter(
65 "%(name)s: [%(levelname)s] %(message)s"))66 "%(name)s: [%(levelname)s] %(message)s"))
66 root.addHandler(handler)67 root.addHandler(handler)
67 root.setLevel(logging.INFO)68 root.setLevel(logging.INFO)
69 # Don't propagate logs up to the root logger.
70 root.propagate = 0
68 return root71 return root
6972
7073
7174
=== modified file 'src/provisioningserver/tests/test_tags.py'
--- src/provisioningserver/tests/test_tags.py 2015-03-25 15:33:23 +0000
+++ src/provisioningserver/tests/test_tags.py 2015-04-14 14:38:55 +0000
@@ -106,7 +106,7 @@
106106
107 def setUp(self):107 def setUp(self):
108 super(TestMergeDetailsCleanly, self).setUp()108 super(TestMergeDetailsCleanly, self).setUp()
109 self.logger = self.useFixture(FakeLogger())109 self.logger = self.useFixture(FakeLogger("maas"))
110110
111 def test_merge_with_no_details(self):111 def test_merge_with_no_details(self):
112 xml = self.do_merge_details({})112 xml = self.do_merge_details({})