Merge lp:~gholt/swift/logroutes into lp:~hudson-openstack/swift/trunk

Proposed by gholt on 2011-02-02
Status: Merged
Approved by: David Goetz on 2011-02-11
Approved revision: 213
Merged at revision: 214
Proposed branch: lp:~gholt/swift/logroutes
Merge into: lp:~hudson-openstack/swift/trunk
Diff against target: 501 lines (+48/-44)
33 files modified
bin/swift-account-stats-logger (+1/-1)
bin/swift-drive-audit (+2/-1)
bin/swift-log-uploader (+1/-1)
swift/account/auditor.py (+1/-1)
swift/account/reaper.py (+1/-1)
swift/account/server.py (+1/-1)
swift/auth/server.py (+1/-1)
swift/common/daemon.py (+2/-2)
swift/common/db.py (+2/-2)
swift/common/db_replicator.py (+1/-1)
swift/common/middleware/catch_errors.py (+1/-5)
swift/common/middleware/cname_lookup.py (+1/-1)
swift/common/middleware/ratelimit.py (+1/-1)
swift/common/middleware/swauth.py (+1/-1)
swift/common/utils.py (+2/-0)
swift/common/wsgi.py (+1/-1)
swift/container/auditor.py (+1/-1)
swift/container/server.py (+1/-1)
swift/container/updater.py (+1/-1)
swift/obj/auditor.py (+1/-1)
swift/obj/replicator.py (+1/-1)
swift/obj/server.py (+1/-1)
swift/obj/updater.py (+1/-1)
swift/proxy/server.py (+1/-1)
swift/stats/access_processor.py (+1/-1)
swift/stats/account_stats.py (+2/-1)
swift/stats/log_processor.py (+2/-2)
swift/stats/log_uploader.py (+3/-2)
swift/stats/stats_processor.py (+1/-1)
test/unit/auth/test_server.py (+2/-2)
test/unit/common/test_daemon.py (+2/-2)
test/unit/common/test_utils.py (+5/-3)
test/unit/obj/test_auditor.py (+2/-1)
To merge this branch: bzr merge lp:~gholt/swift/logroutes
Reviewer Review Type Date Requested Status
clayg 2011-02-02 Approve on 2011-02-10
Review via email: mp+48388@code.launchpad.net

Commit message

logging: use routes to separate logging configurations

Description of the change

logging: use routes to separate logging configurations

Specifically, this fixes using different log_level settings even if the same log_name is used.

To post a comment you must log in.
lp:~gholt/swift/logroutes updated on 2011-02-09
209. By gholt on 2011-02-09

Merge from trunk

clayg (clay-gerrard) wrote :

Calling get_logger with a log_route kwarg instead of name as a positional argument isn't really the same thing. It may even have some side-effects that weren't intended?

e.g.
the drive-audit script logs as "swift" instead of "drive-audit"
swift-account-stats-logger logs as "log-processor-stats" instead of "swift-account-stats-logger" or just "account-stats"

I think things mostly sorta "work" because these conf dicts are coming out of readconf and run_wsgi which will both throw in a log_name key set to the section_name if there isn't something there already.

On the other hand... with this branch I can finally set a log_name for the auditors, updaters and replicators... so maybe it's a net gain?

gholt (gholt) wrote :

No, all that was intended. This separates the naming from the routing, then tries to get the naming defaults configured back to what they originally were, or what I thought was intended. I just missed some naming on items apparently.

I'll get the drive-audit name fixed. With the log processing stuff, I got lost pretty quick on what was intended to be named what and meant to tap you and John on that (but obviously forgot). Most everything in the system logs with no "swift-" prefix, but some of the log stuff was previously.

lp:~gholt/swift/logroutes updated on 2011-02-10
210. By gholt on 2011-02-10

Fix drive-audit's default log_name

gholt (gholt) wrote :

Fixed the drive-audit log name.

Maybe this comment doesn't belong here, but it's logging related so maybe it does, I dunno. :)

The log processing stuff is a bit confusing to me since it doesn't follow the model the rest of the code does. i.e. binary name ~= section name == default log name. It doesn't even seem to have consistency on it's own, really.

From trunk it seems to be:

The bin/swift-account-stats-logger uses the section log-processor-stats and logs as swift-account-stats-logger. Apparently this thing needs write access to my logs directory as well, but that's another discussion. :P

The bin/swift-log-stats-collector uses the section log-processor and logs as swift and log-stats-collector.

The bin/swift-log-uploader uses the section log-processor and logs as swift or just the plugin name (such as "access").

So, perhaps I can be forgiven for not knowing what to do with these during this logging refactor? I really don't want to mimic this behavior in this branch, unless that's really, really what's needed.

gholt (gholt) wrote :

Desnarkified by clayg and ready for re-review!

lp:~gholt/swift/logroutes updated on 2011-02-10
211. By gholt on 2011-02-10

Merge from ~clay-gerrard/swift/logroutes

clayg (clay-gerrard) wrote :

you are forgiven

review: Approve
lp:~gholt/swift/logroutes updated on 2011-02-10
212. By gholt on 2011-02-10

Merge from trunk

213. By gholt on 2011-02-10

PEP8 Fixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/swift-account-stats-logger'
2--- bin/swift-account-stats-logger 2011-01-04 23:34:43 +0000
3+++ bin/swift-account-stats-logger 2011-02-10 23:12:47 +0000
4@@ -23,4 +23,4 @@
5 # currently AccountStat only supports run_once
6 options['once'] = True
7 run_daemon(AccountStat, conf_file, section_name='log-processor-stats',
8- **options)
9+ log_name="account-stats", **options)
10
11=== modified file 'bin/swift-drive-audit'
12--- bin/swift-drive-audit 2011-01-26 22:31:33 +0000
13+++ bin/swift-drive-audit 2011-02-10 23:12:47 +0000
14@@ -99,7 +99,8 @@
15 device_dir = conf.get('device_dir', '/srv/node')
16 minutes = int(conf.get('minutes', 60))
17 error_limit = int(conf.get('error_limit', 1))
18- logger = get_logger(conf, 'drive-audit')
19+ conf['log_name'] = conf.get('log_name', 'drive-audit')
20+ logger = get_logger(conf, log_route='drive-audit')
21 devices = get_devices(device_dir, logger)
22 logger.debug("Devices found: %s" % str(devices))
23 if not devices:
24
25=== modified file 'bin/swift-log-uploader'
26--- bin/swift-log-uploader 2011-01-04 23:34:43 +0000
27+++ bin/swift-log-uploader 2011-02-10 23:12:47 +0000
28@@ -34,7 +34,7 @@
29 uploader_conf.update(plugin_conf)
30
31 # pre-configure logger
32- logger = utils.get_logger(uploader_conf, plugin,
33+ logger = utils.get_logger(uploader_conf, log_route='log-uploader',
34 log_to_console=options.get('verbose', False))
35 # currently LogUploader only supports run_once
36 options['once'] = True
37
38=== modified file 'swift/account/auditor.py'
39--- swift/account/auditor.py 2011-01-04 23:34:43 +0000
40+++ swift/account/auditor.py 2011-02-10 23:12:47 +0000
41@@ -28,7 +28,7 @@
42
43 def __init__(self, conf):
44 self.conf = conf
45- self.logger = get_logger(conf, 'account-auditor')
46+ self.logger = get_logger(conf, log_route='account-auditor')
47 self.devices = conf.get('devices', '/srv/node')
48 self.mount_check = conf.get('mount_check', 'true').lower() in \
49 ('true', 't', '1', 'on', 'yes', 'y')
50
51=== modified file 'swift/account/reaper.py'
52--- swift/account/reaper.py 2011-01-19 23:21:57 +0000
53+++ swift/account/reaper.py 2011-02-10 23:12:47 +0000
54@@ -53,7 +53,7 @@
55
56 def __init__(self, conf):
57 self.conf = conf
58- self.logger = get_logger(conf)
59+ self.logger = get_logger(conf, log_route='account-reaper')
60 self.devices = conf.get('devices', '/srv/node')
61 self.mount_check = conf.get('mount_check', 'true').lower() in \
62 ('true', 't', '1', 'on', 'yes', 'y')
63
64=== modified file 'swift/account/server.py'
65--- swift/account/server.py 2011-01-29 19:26:06 +0000
66+++ swift/account/server.py 2011-02-10 23:12:47 +0000
67@@ -42,7 +42,7 @@
68 """WSGI controller for the account server."""
69
70 def __init__(self, conf):
71- self.logger = get_logger(conf)
72+ self.logger = get_logger(conf, log_route='account-server')
73 self.root = conf.get('devices', '/srv/node')
74 self.mount_check = conf.get('mount_check', 'true').lower() in \
75 ('true', 't', '1', 'on', 'yes', 'y')
76
77=== modified file 'swift/auth/server.py'
78--- swift/auth/server.py 2011-01-26 22:38:13 +0000
79+++ swift/auth/server.py 2011-02-10 23:12:47 +0000
80@@ -90,7 +90,7 @@
81 """
82
83 def __init__(self, conf):
84- self.logger = get_logger(conf)
85+ self.logger = get_logger(conf, log_route='auth-server')
86 self.super_admin_key = conf.get('super_admin_key')
87 if not self.super_admin_key:
88 msg = _('No super_admin_key set in conf file! Exiting.')
89
90=== modified file 'swift/common/daemon.py'
91--- swift/common/daemon.py 2011-01-04 23:34:43 +0000
92+++ swift/common/daemon.py 2011-02-10 23:12:47 +0000
93@@ -26,7 +26,7 @@
94
95 def __init__(self, conf):
96 self.conf = conf
97- self.logger = utils.get_logger(conf, 'swift-daemon')
98+ self.logger = utils.get_logger(conf, log_route='daemon')
99
100 def run_once(self):
101 """Override this to run the script once"""
102@@ -84,7 +84,7 @@
103 logger = kwargs.pop('logger')
104 else:
105 logger = utils.get_logger(conf, conf.get('log_name', section_name),
106- log_to_console=kwargs.pop('verbose', False))
107+ log_to_console=kwargs.pop('verbose', False), log_route=section_name)
108 try:
109 klass(conf).run(once=once, **kwargs)
110 except KeyboardInterrupt:
111
112=== modified file 'swift/common/db.py'
113--- swift/common/db.py 2011-02-04 19:50:30 +0000
114+++ swift/common/db.py 2011-02-10 23:12:47 +0000
115@@ -287,7 +287,7 @@
116 self.conn = None
117 orig_isolation_level = conn.isolation_level
118 conn.isolation_level = None
119- conn.execute('PRAGMA journal_mode = DELETE') # remove any journal files
120+ conn.execute('PRAGMA journal_mode = DELETE') # remove journal files
121 conn.execute('BEGIN IMMEDIATE')
122 try:
123 yield True
124@@ -295,7 +295,7 @@
125 pass
126 try:
127 conn.execute('ROLLBACK')
128- conn.execute('PRAGMA journal_mode = WAL') # back to WAL mode
129+ conn.execute('PRAGMA journal_mode = WAL') # back to WAL mode
130 conn.isolation_level = orig_isolation_level
131 self.conn = conn
132 except Exception:
133
134=== modified file 'swift/common/db_replicator.py'
135--- swift/common/db_replicator.py 2011-01-29 19:26:06 +0000
136+++ swift/common/db_replicator.py 2011-02-10 23:12:47 +0000
137@@ -92,7 +92,7 @@
138
139 def __init__(self, conf):
140 self.conf = conf
141- self.logger = get_logger(conf)
142+ self.logger = get_logger(conf, log_route='replicator')
143 self.root = conf.get('devices', '/srv/node')
144 self.mount_check = conf.get('mount_check', 'true').lower() in \
145 ('true', 't', '1', 'on', 'yes', 'y')
146
147=== modified file 'swift/common/middleware/catch_errors.py'
148--- swift/common/middleware/catch_errors.py 2011-01-07 21:17:29 +0000
149+++ swift/common/middleware/catch_errors.py 2011-02-10 23:12:47 +0000
150@@ -26,11 +26,7 @@
151
152 def __init__(self, app, conf):
153 self.app = app
154- # if the application already has a logger we should use that one
155- self.logger = getattr(app, 'logger', None)
156- if not self.logger:
157- # and only call get_logger if we have to
158- self.logger = get_logger(conf)
159+ self.logger = get_logger(conf, log_route='catch-errors')
160
161 def __call__(self, env, start_response):
162 try:
163
164=== modified file 'swift/common/middleware/cname_lookup.py'
165--- swift/common/middleware/cname_lookup.py 2011-01-20 20:15:05 +0000
166+++ swift/common/middleware/cname_lookup.py 2011-02-10 23:12:47 +0000
167@@ -53,7 +53,7 @@
168 self.storage_domain = '.' + self.storage_domain
169 self.lookup_depth = int(conf.get('lookup_depth', '1'))
170 self.memcache = None
171- self.logger = get_logger(conf)
172+ self.logger = get_logger(conf, log_route='cname-lookup')
173
174 def __call__(self, env, start_response):
175 if not self.storage_domain:
176
177=== modified file 'swift/common/middleware/ratelimit.py'
178--- swift/common/middleware/ratelimit.py 2011-01-22 00:28:58 +0000
179+++ swift/common/middleware/ratelimit.py 2011-02-10 23:12:47 +0000
180@@ -39,7 +39,7 @@
181 if logger:
182 self.logger = logger
183 else:
184- self.logger = get_logger(conf)
185+ self.logger = get_logger(conf, log_route='ratelimit')
186 self.account_ratelimit = float(conf.get('account_ratelimit', 0))
187 self.max_sleep_time_seconds = \
188 float(conf.get('max_sleep_time_seconds', 60))
189
190=== modified file 'swift/common/middleware/swauth.py'
191--- swift/common/middleware/swauth.py 2011-02-02 18:23:01 +0000
192+++ swift/common/middleware/swauth.py 2011-02-10 23:12:47 +0000
193@@ -51,7 +51,7 @@
194 def __init__(self, app, conf):
195 self.app = app
196 self.conf = conf
197- self.logger = get_logger(conf)
198+ self.logger = get_logger(conf, log_route='swauth')
199 self.log_headers = conf.get('log_headers') == 'True'
200 self.reseller_prefix = conf.get('reseller_prefix', 'AUTH').strip()
201 if self.reseller_prefix and self.reseller_prefix[-1] != '_':
202
203=== modified file 'swift/common/utils.py'
204--- swift/common/utils.py 2011-02-10 21:23:59 +0000
205+++ swift/common/utils.py 2011-02-10 23:12:47 +0000
206@@ -390,6 +390,8 @@
207 :param conf: Configuration dict to read settings from
208 :param name: Name of the logger
209 :param log_to_console: Add handler which writes to console on stderr
210+ :param log_route: Route for the logging, not emitted to the log, just used
211+ to separate logging configurations
212 :param fmt: Override log format
213 """
214 if not conf:
215
216=== modified file 'swift/common/wsgi.py'
217--- swift/common/wsgi.py 2011-02-05 21:38:49 +0000
218+++ swift/common/wsgi.py 2011-02-10 23:12:47 +0000
219@@ -113,7 +113,7 @@
220 logger = kwargs.pop('logger')
221 else:
222 logger = get_logger(conf, log_name,
223- log_to_console=kwargs.pop('verbose', False))
224+ log_to_console=kwargs.pop('verbose', False), log_route='wsgi')
225
226 # redirect errors to logger and close stdio
227 capture_stdio(logger)
228
229=== modified file 'swift/container/auditor.py'
230--- swift/container/auditor.py 2011-01-04 23:34:43 +0000
231+++ swift/container/auditor.py 2011-02-10 23:12:47 +0000
232@@ -28,7 +28,7 @@
233
234 def __init__(self, conf):
235 self.conf = conf
236- self.logger = get_logger(conf, 'container-auditor')
237+ self.logger = get_logger(conf, log_route='container-auditor')
238 self.devices = conf.get('devices', '/srv/node')
239 self.mount_check = conf.get('mount_check', 'true').lower() in \
240 ('true', 't', '1', 'on', 'yes', 'y')
241
242=== modified file 'swift/container/server.py'
243--- swift/container/server.py 2011-01-29 19:26:06 +0000
244+++ swift/container/server.py 2011-02-10 23:12:47 +0000
245@@ -49,7 +49,7 @@
246 save_headers = ['x-container-read', 'x-container-write']
247
248 def __init__(self, conf):
249- self.logger = get_logger(conf)
250+ self.logger = get_logger(conf, log_route='container-server')
251 self.root = conf.get('devices', '/srv/node/')
252 self.mount_check = conf.get('mount_check', 'true').lower() in \
253 ('true', 't', '1', 'on', 'yes', 'y')
254
255=== modified file 'swift/container/updater.py'
256--- swift/container/updater.py 2011-01-26 22:38:13 +0000
257+++ swift/container/updater.py 2011-02-10 23:12:47 +0000
258@@ -37,7 +37,7 @@
259
260 def __init__(self, conf):
261 self.conf = conf
262- self.logger = get_logger(conf, 'container-updater')
263+ self.logger = get_logger(conf, log_route='container-updater')
264 self.devices = conf.get('devices', '/srv/node')
265 self.mount_check = conf.get('mount_check', 'true').lower() in \
266 ('true', 't', '1', 'on', 'yes', 'y')
267
268=== modified file 'swift/obj/auditor.py'
269--- swift/obj/auditor.py 2011-01-21 01:05:44 +0000
270+++ swift/obj/auditor.py 2011-02-10 23:12:47 +0000
271@@ -31,7 +31,7 @@
272
273 def __init__(self, conf):
274 self.conf = conf
275- self.logger = get_logger(conf, 'object-auditor')
276+ self.logger = get_logger(conf, log_route='object-auditor')
277 self.devices = conf.get('devices', '/srv/node')
278 self.mount_check = conf.get('mount_check', 'true').lower() in \
279 ('true', 't', '1', 'on', 'yes', 'y')
280
281=== modified file 'swift/obj/replicator.py'
282--- swift/obj/replicator.py 2011-01-27 22:42:36 +0000
283+++ swift/obj/replicator.py 2011-02-10 23:12:47 +0000
284@@ -207,7 +207,7 @@
285 :param logger: logging object
286 """
287 self.conf = conf
288- self.logger = get_logger(conf, 'object-replicator')
289+ self.logger = get_logger(conf, log_route='object-replicator')
290 self.devices_dir = conf.get('devices', '/srv/node')
291 self.mount_check = conf.get('mount_check', 'true').lower() in \
292 ('true', 't', '1', 'on', 'yes', 'y')
293
294=== modified file 'swift/obj/server.py'
295--- swift/obj/server.py 2011-01-26 22:38:13 +0000
296+++ swift/obj/server.py 2011-02-10 23:12:47 +0000
297@@ -266,7 +266,7 @@
298 <source-dir>/etc/object-server.conf-sample or
299 /etc/swift/object-server.conf-sample.
300 """
301- self.logger = get_logger(conf)
302+ self.logger = get_logger(conf, log_route='object-server')
303 self.devices = conf.get('devices', '/srv/node/')
304 self.mount_check = conf.get('mount_check', 'true').lower() in \
305 ('true', 't', '1', 'on', 'yes', 'y')
306
307=== modified file 'swift/obj/updater.py'
308--- swift/obj/updater.py 2011-01-26 22:31:33 +0000
309+++ swift/obj/updater.py 2011-02-10 23:12:47 +0000
310@@ -35,7 +35,7 @@
311
312 def __init__(self, conf):
313 self.conf = conf
314- self.logger = get_logger(conf, 'object-updater')
315+ self.logger = get_logger(conf, log_route='object-updater')
316 self.devices = conf.get('devices', '/srv/node')
317 self.mount_check = conf.get('mount_check', 'true').lower() in \
318 ('true', 't', '1', 'on', 'yes', 'y')
319
320=== modified file 'swift/proxy/server.py'
321--- swift/proxy/server.py 2011-02-10 20:59:52 +0000
322+++ swift/proxy/server.py 2011-02-10 23:12:47 +0000
323@@ -1609,7 +1609,7 @@
324 if conf is None:
325 conf = {}
326 if logger is None:
327- self.logger = get_logger(conf)
328+ self.logger = get_logger(conf, log_route='proxy-server')
329 access_log_conf = {}
330 for key in ('log_facility', 'log_name', 'log_level'):
331 value = conf.get('access_' + key, conf.get(key, None))
332
333=== modified file 'swift/stats/access_processor.py'
334--- swift/stats/access_processor.py 2011-01-17 17:07:58 +0000
335+++ swift/stats/access_processor.py 2011-02-10 23:12:47 +0000
336@@ -34,7 +34,7 @@
337 conf.get('service_ips', '').split(',')\
338 if x.strip()]
339 self.warn_percent = float(conf.get('warn_percent', '0.8'))
340- self.logger = get_logger(conf)
341+ self.logger = get_logger(conf, log_route='access-processor')
342
343 def log_line_parser(self, raw_log):
344 '''given a raw access log line, return a dict of the good parts'''
345
346=== modified file 'swift/stats/account_stats.py'
347--- swift/stats/account_stats.py 2011-01-30 14:59:35 +0000
348+++ swift/stats/account_stats.py 2011-02-10 23:12:47 +0000
349@@ -48,7 +48,8 @@
350 self.devices = server_conf.get('devices', '/srv/node')
351 self.mount_check = server_conf.get('mount_check', 'true').lower() in \
352 ('true', 't', '1', 'on', 'yes', 'y')
353- self.logger = get_logger(stats_conf, 'swift-account-stats-logger')
354+ self.logger = \
355+ get_logger(stats_conf, log_route='account-stats')
356
357 def run_once(self):
358 self.logger.info(_("Gathering account stats"))
359
360=== modified file 'swift/stats/log_processor.py'
361--- swift/stats/log_processor.py 2011-01-26 22:38:13 +0000
362+++ swift/stats/log_processor.py 2011-02-10 23:12:47 +0000
363@@ -40,7 +40,7 @@
364
365 def __init__(self, conf, logger):
366 if isinstance(logger, tuple):
367- self.logger = get_logger(*logger)
368+ self.logger = get_logger(*logger, log_route='log-processor')
369 else:
370 self.logger = logger
371
372@@ -226,7 +226,7 @@
373 c = conf.get('log-processor')
374 super(LogProcessorDaemon, self).__init__(c)
375 self.total_conf = conf
376- self.logger = get_logger(c)
377+ self.logger = get_logger(c, log_route='log-processor')
378 self.log_processor = LogProcessor(conf, self.logger)
379 self.lookback_hours = int(c.get('lookback_hours', '120'))
380 self.lookback_window = int(c.get('lookback_window',
381
382=== modified file 'swift/stats/log_uploader.py'
383--- swift/stats/log_uploader.py 2011-01-14 08:45:39 +0000
384+++ swift/stats/log_uploader.py 2011-02-10 23:12:47 +0000
385@@ -64,8 +64,9 @@
386 self.container_name = container_name
387 self.filename_format = source_filename_format
388 self.internal_proxy = InternalProxy(proxy_server_conf)
389- log_name = 'swift-log-uploader-%s' % plugin_name
390- self.logger = utils.get_logger(uploader_conf, plugin_name)
391+ log_name = '%s-log-uploader' % plugin_name
392+ self.logger = utils.get_logger(uploader_conf, log_name,
393+ log_route=plugin_name)
394
395 def run_once(self):
396 self.logger.info(_("Uploading logs"))
397
398=== modified file 'swift/stats/stats_processor.py'
399--- swift/stats/stats_processor.py 2011-01-19 23:21:57 +0000
400+++ swift/stats/stats_processor.py 2011-02-10 23:12:47 +0000
401@@ -20,7 +20,7 @@
402 """Transform account storage stat logs"""
403
404 def __init__(self, conf):
405- self.logger = get_logger(conf)
406+ self.logger = get_logger(conf, log_route='stats-processor')
407
408 def process(self, obj_stream, data_object_account, data_object_container,
409 data_object_name):
410
411=== modified file 'test/unit/auth/test_server.py'
412--- test/unit/auth/test_server.py 2011-01-19 23:21:57 +0000
413+++ test/unit/auth/test_server.py 2011-02-10 23:12:47 +0000
414@@ -456,7 +456,7 @@
415 def test_basic_logging(self):
416 log = StringIO()
417 log_handler = StreamHandler(log)
418- logger = get_logger(self.conf, 'auth')
419+ logger = get_logger(self.conf, 'auth-server', log_route='auth-server')
420 logger.logger.addHandler(log_handler)
421 try:
422 auth_server.http_connect = fake_http_connect(201)
423@@ -534,7 +534,7 @@
424 orig_Request = auth_server.Request
425 log = StringIO()
426 log_handler = StreamHandler(log)
427- logger = get_logger(self.conf, 'auth')
428+ logger = get_logger(self.conf, 'auth-server', log_route='auth-server')
429 logger.logger.addHandler(log_handler)
430 try:
431 auth_server.Request = request_causing_exception
432
433=== modified file 'test/unit/common/test_daemon.py'
434--- test/unit/common/test_daemon.py 2011-02-02 17:38:17 +0000
435+++ test/unit/common/test_daemon.py 2011-02-10 23:12:47 +0000
436@@ -28,7 +28,7 @@
437
438 def __init__(self, conf):
439 self.conf = conf
440- self.logger = utils.get_logger(None, 'server')
441+ self.logger = utils.get_logger(None, 'server', log_route='server')
442 MyDaemon.forever_called = False
443 MyDaemon.once_called = False
444
445@@ -99,7 +99,7 @@
446 sio = StringIO()
447 logger = logging.getLogger('server')
448 logger.addHandler(logging.StreamHandler(sio))
449- logger = utils.get_logger(None, 'server')
450+ logger = utils.get_logger(None, 'server', log_route='server')
451 daemon.run_daemon(MyDaemon, conf_file, logger=logger)
452 self.assert_('user quit' in sio.getvalue().lower())
453
454
455=== modified file 'test/unit/common/test_utils.py'
456--- test/unit/common/test_utils.py 2011-02-10 20:59:52 +0000
457+++ test/unit/common/test_utils.py 2011-02-10 23:12:47 +0000
458@@ -303,17 +303,19 @@
459 sio = StringIO()
460 logger = logging.getLogger('server')
461 logger.addHandler(logging.StreamHandler(sio))
462- logger = utils.get_logger(None, 'server')
463+ logger = utils.get_logger(None, 'server', log_route='server')
464 logger.warn('test1')
465 self.assertEquals(sio.getvalue(), 'test1\n')
466 logger.debug('test2')
467 self.assertEquals(sio.getvalue(), 'test1\n')
468- logger = utils.get_logger({'log_level': 'DEBUG'}, 'server')
469+ logger = utils.get_logger({'log_level': 'DEBUG'}, 'server',
470+ log_route='server')
471 logger.debug('test3')
472 self.assertEquals(sio.getvalue(), 'test1\ntest3\n')
473 # Doesn't really test that the log facility is truly being used all the
474 # way to syslog; but exercises the code.
475- logger = utils.get_logger({'log_facility': 'LOG_LOCAL3'}, 'server')
476+ logger = utils.get_logger({'log_facility': 'LOG_LOCAL3'}, 'server',
477+ log_route='server')
478 logger.warn('test4')
479 self.assertEquals(sio.getvalue(),
480 'test1\ntest3\ntest4\n')
481
482=== modified file 'test/unit/obj/test_auditor.py'
483--- test/unit/obj/test_auditor.py 2011-01-25 01:12:38 +0000
484+++ test/unit/obj/test_auditor.py 2011-02-10 23:12:47 +0000
485@@ -14,7 +14,7 @@
486 # limitations under the License.
487
488 # TODO: Tests
489-from test import unit as _setup_mocks
490+from test import unit
491 import unittest
492 import tempfile
493 import os
494@@ -57,6 +57,7 @@
495
496 def tearDown(self):
497 rmtree(os.path.dirname(self.testdir), ignore_errors=1)
498+ unit.xattr_data = {}
499
500 def test_object_audit_extra_data(self):
501 self.auditor = auditor.ObjectAuditor(self.conf)