rackerlabs/otter — pull request #509 by cyli (2013-12-21 00:14:32+00:00)
Title: Pass a bound log to the auth functions so that auth logs have a transaction id

Prior to this PR:

2013-12-20_22:48:20.05562 {"authenticator": "", "cache_ttl": 300, "facility": "otter.auth.cache", "full_message": "otter.auth.cache.miss", "host": "ubuntu", "level": 6, "short_message": "otter.auth.cache.miss", "tenant_id": "851153", "timestamp": 1387579700.055518, "version": "1.0"}
2013-12-20_22:48:20.05683 {"facility": "otter.supervisor.validate_launch_config", "full_message": "Authenticating for tenant", "host": "ubuntu", "level": 6, "short_message": "Authenticating for tenant", "tenant_id": "851153", "timestamp": 1387579700.056748, "transaction_id": "9e0f758e-492e-4b00-93c5-cc7264ca7996", "version": "1.0"}
2013-12-20_22:48:20.07995 {"facility": "treq.request", "full_message": "Request to post http://localhost:8901/v2.0/tokens resulted in a 200 response after 0.0225999355316 seconds.", "headers": "Headers({'date': ['Fri, 20 Dec 2013 22:48:20 GMT'], 'content-encoding': [''], 'content-type': ['application/json'], 'server': ['TwistedWeb/13.1.0']})", "host": "ubuntu", "level": 6, "method": "post", "request_time": 0.02259993553161621, "short_message": "Request to post http://localhost:8901/v2.0/tokens resulted in a 200 response after 0.0225999355316 seconds.", "status_code": 200, "timestamp": 1387579700.07861, "url": "http://localhost:8901/v2.0/tokens", "version": "1.0"}
2013-12-20_22:48:20.08536 {"facility": "treq.request", "full_message": "Request to get http://localhost:8901/v1.1/mosso/851153 resulted in a 301 response after 0.00326013565063 seconds.", "headers": "Headers({'date': ['Fri, 20 Dec 2013 22:48:20 GMT'], 'content-encoding': [''], 'content-type': ['application/json'], 'server': ['TwistedWeb/13.1.0']})", "host": "ubuntu", "level": 6, "method": "get", "request_time": 0.0032601356506347656, "short_message": "Request to get http://localhost:8901/v1.1/mosso/851153 resulted in a 301 response after 0.00326013565063 seconds.", "status_code": 301, "timestamp": 1387579700.085224, "url": "http://localhost:8901/v1.1/mosso/851153", "version": "1.0"}
2013-12-20_22:48:20.08810 {"facility": "treq.request", "full_message": "Request to post http://localhost:8901/v2.0/RAX-AUTH/impersonation-tokens resulted in a 200 response after 0.00197291374207 seconds.", "headers": "Headers({'date': ['Fri, 20 Dec 2013 22:48:20 GMT'], 'content-encoding': [''], 'content-type': ['application/json'], 'server': ['TwistedWeb/13.1.0']})", "host": "ubuntu", "level": 6, "method": "post", "request_time": 0.0019729137420654297, "short_message": "Request to post http://localhost:8901/v2.0/RAX-AUTH/impersonation-tokens resulted in a 200 response after 0.00197291374207 seconds.", "status_code": 200, "timestamp": 1387579700.087969, "url": "http://localhost:8901/v2.0/RAX-AUTH/impersonation-tokens", "version": "1.0"}
2013-12-20_22:48:20.09105 {"facility": "treq.request", "full_message": "Request to get http://localhost:8901/v2.0/tokens/mocked-token4731993/endpoints resulted in a 200 response after 0.00207901000977 seconds.", "headers": "Headers({'date': ['Fri, 20 Dec 2013 22:48:20 GMT'], 'content-encoding': [''], 'content-type': ['application/json'], 'server': ['TwistedWeb/13.1.0']})", "host": "ubuntu", "level": 6, "method": "get", "request_time": 0.002079010009765625, "short_message": "Request to get http://localhost:8901/v2.0/tokens/mocked-token4731993/endpoints resulted in a 200 response after 0.00207901000977 seconds.", "status_code": 200, "timestamp": 1387579700.090774, "url": "http://localhost:8901/v2.0/tokens/mocked-token4731993/endpoints", "version": "1.0"}
2013-12-20_22:48:20.09215 {"authenticator": "", "cache_ttl": 300, "facility": "otter.auth.cache", "full_message": "otter.auth.cache.populate", "host": "ubuntu", "level": 6, "short_message": "otter.auth.cache.populate", "tenant_id": "851153", "timestamp": 1387579700.092046, "version": "1.0"}

With this PR:
2013-12-20_22:50:39.28288 {"authenticator": "", "cache_ttl": 300, "facility": "otter.auth.cache", "full_message": "otter.auth.cache.miss", "host": "ubuntu", "level": 6, "short_message": "otter.auth.cache.miss", "tenant_id": "851153", "timestamp": 1387579839.282761, "transaction_id": "3fce8a0a-239f-4f14-b74c-fac78b74b90f", "version": "1.0"}
2013-12-20_22:50:39.28409 {"facility": "otter.supervisor.validate_launch_config", "full_message": "Authenticating for tenant", "host": "ubuntu", "level": 6, "short_message": "Authenticating for tenant", "tenant_id": "851153", "timestamp": 1387579839.283938, "transaction_id": "3fce8a0a-239f-4f14-b74c-fac78b74b90f", "version": "1.0"}
2013-12-20_22:50:39.34970 {"authenticator": "", "cache_ttl": 300, "facility": "treq.request", "full_message": "Request to post http://localhost:8901/v2.0/tokens resulted in a 200 response after 0.0662040710449 seconds.", "headers": "Headers({'date': ['Fri, 20 Dec 2013 22:50:39 GMT'], 'content-encoding': [''], 'content-type': ['application/json'], 'server': ['TwistedWeb/13.1.0']})", "host": "ubuntu", "level": 6, "method": "post", "request_time": 0.06620407104492188, "short_message": "Request to post http://localhost:8901/v2.0/tokens resulted in a 200 response after 0.0662040710449 seconds.", "status_code": 200, "tenant_id": "851153", "timestamp": 1387579839.349564, "transaction_id": "3fce8a0a-239f-4f14-b74c-fac78b74b90f", "url": "http://localhost:8901/v2.0/tokens", "version": "1.0"}
2013-12-20_22:50:39.35978 {"authenticator": "", "cache_ttl": 300, "facility": "treq.request", "full_message": "Request to get http://localhost:8901/v1.1/mosso/851153 resulted in a 301 response after 0.00959300994873 seconds.", "headers": "Headers({'date': ['Fri, 20 Dec 2013 22:50:39 GMT'], 'content-encoding': [''], 'content-type': ['application/json'], 'server': ['TwistedWeb/13.1.0']})", "host": "ubuntu", "level": 6, "method": "get", "request_time": 0.009593009948730469, "short_message": "Request to get http://localhost:8901/v1.1/mosso/851153 resulted in a 301 response after 0.00959300994873 seconds.", "status_code": 301, "tenant_id": "851153", "timestamp": 1387579839.359624, "transaction_id": "3fce8a0a-239f-4f14-b74c-fac78b74b90f", "url": "http://localhost:8901/v1.1/mosso/851153", "version": "1.0"}
2013-12-20_22:50:39.36241 {"authenticator": "", "cache_ttl": 300, "facility": "treq.request", "full_message": "Request to post http://localhost:8901/v2.0/RAX-AUTH/impersonation-tokens resulted in a 200 response after 0.00219488143921 seconds.", "headers": "Headers({'date': ['Fri, 20 Dec 2013 22:50:39 GMT'], 'content-encoding': [''], 'content-type': ['application/json'], 'server': ['TwistedWeb/13.1.0']})", "host": "ubuntu", "level": 6, "method": "post", "request_time": 0.0021948814392089844, "short_message": "Request to post http://localhost:8901/v2.0/RAX-AUTH/impersonation-tokens resulted in a 200 response after 0.00219488143921 seconds.", "status_code": 200, "tenant_id": "851153", "timestamp": 1387579839.362285, "transaction_id": "3fce8a0a-239f-4f14-b74c-fac78b74b90f", "url": "http://localhost:8901/v2.0/RAX-AUTH/impersonation-tokens", "version": "1.0"}
2013-12-20_22:50:39.36492 {"authenticator": "", "cache_ttl": 300, "facility": "treq.request", "full_message": "Request to get http://localhost:8901/v2.0/tokens/mocked-token4161808/endpoints resulted in a 200 response after 0.00192499160767 seconds.", "headers": "Headers({'date': ['Fri, 20 Dec 2013 22:50:39 GMT'], 'content-encoding': [''], 'content-type': ['application/json'], 'server': ['TwistedWeb/13.1.0']})", "host": "ubuntu", "level": 6, "method": "get", "request_time": 0.0019249916076660156, "short_message": "Request to get http://localhost:8901/v2.0/tokens/mocked-token4161808/endpoints resulted in a 200 response after 0.00192499160767 seconds.", "status_code": 200, "tenant_id": "851153", "timestamp": 1387579839.364601, "transaction_id": "3fce8a0a-239f-4f14-b74c-fac78b74b90f", "url": "http://localhost:8901/v2.0/tokens/mocked-token4161808/endpoints", "version": "1.0"}
2013-12-20_22:50:39.36528 {"authenticator": "", "cache_ttl": 300, "facility": "otter.auth.cache", "full_message": "otter.auth.cache.populate", "host": "ubuntu", "level": 6, "short_message": "otter.auth.cache.populate", "tenant_id": "851153", "timestamp": 1387579839.365186, "transaction_id": "3fce8a0a-239f-4f14-b74c-fac78b74b90f", "version": "1.0"}