)]}'
{"specs/mitaka/request-logs-on-failure.rst":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"9f4254daf1a8d053e0abfa056e4128df0ece3ad3","unresolved":false,"context_lines":[{"line_number":48,"context_line":"INFO and higher would be duplicated between the buffer and the main log. If"},{"line_number":49,"context_line":"the request completes successfully, the buffer is simply thrown away."},{"line_number":50,"context_line":"Otherwise, it is written to a configurable location which defaults to"},{"line_number":51,"context_line":"``/var/log/{service}/requests/`` using the request ID as the filename."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Periodic tasks could be dealt with similarly, with each execution treated like"},{"line_number":54,"context_line":"an API request. Once the initial work is completed to provide the log-buffering"}],"source_content_type":"text/x-rst","patch_set":1,"id":"7a2fa921_be412fab","line":51,"updated":"2015-10-08 20:07:17.000000000","message":"How do we differentiate between a request that fails for a valid reason (the user does not have permission, there are no resources to fulfill the request, the user has provided bad inputs, etc.) and those that fail due to a system error of some sort (a crash on the other end of an RPC call, etc.)? Should we?","commit_id":"790412ec7a81ba69fedc63552e9b4e522eb6ea8e"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"f46256aab52e3362401c4299e9121ac62c3710e8","unresolved":false,"context_lines":[{"line_number":48,"context_line":"INFO and higher would be duplicated between the buffer and the main log. If"},{"line_number":49,"context_line":"the request completes successfully, the buffer is simply thrown away."},{"line_number":50,"context_line":"Otherwise, it is written to a configurable location which defaults to"},{"line_number":51,"context_line":"``/var/log/{service}/requests/`` using the request ID as the filename."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Periodic tasks could be dealt with similarly, with each execution treated like"},{"line_number":54,"context_line":"an API request. Once the initial work is completed to provide the log-buffering"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a2ca52d_79a0d643","line":51,"in_reply_to":"7a2fa921_be412fab","updated":"2015-10-15 12:48:11.000000000","message":"Good question! My impulse is to only log these for internal server errors (HTTP 5xx). In an \"expected exception\" case, normal logging should do first-failure data capture. I don\u0027t know if we can achieve this differentiation transparently to application code as I believe exceptions are often raised for stuff like invalid requests.","commit_id":"790412ec7a81ba69fedc63552e9b4e522eb6ea8e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"9f4254daf1a8d053e0abfa056e4128df0ece3ad3","unresolved":false,"context_lines":[{"line_number":59,"context_line":"buffering will not be activated. The size of log buffers will also be tunable"},{"line_number":60,"context_line":"by services, so they can control how much memory is consumed. Many services"},{"line_number":61,"context_line":"will also want to expose this so operators can customise it according to their"},{"line_number":62,"context_line":"hardware."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"Alternatives"},{"line_number":65,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"7a2fa921_7ed95721","line":62,"updated":"2015-10-08 20:07:17.000000000","message":"This sounds a lot like what https://pypi.python.org/pypi/bbrecorder/ appears to do. Have you investigated integrating that library with oslo.log in some way?\n\nI think what you want is a request-specific log handler to be added to the logging configuration for each request, to only have that handler flush to disk in the event of an error (relaying that to the handler might be possible just by calling the error() or exception() methods) and then to throw away the log handler after each request. I think that encapsulates the buffer management you\u0027re talking about and avoids us having to make application code aware of this feature.","commit_id":"790412ec7a81ba69fedc63552e9b4e522eb6ea8e"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"f46256aab52e3362401c4299e9121ac62c3710e8","unresolved":false,"context_lines":[{"line_number":59,"context_line":"buffering will not be activated. The size of log buffers will also be tunable"},{"line_number":60,"context_line":"by services, so they can control how much memory is consumed. Many services"},{"line_number":61,"context_line":"will also want to expose this so operators can customise it according to their"},{"line_number":62,"context_line":"hardware."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"Alternatives"},{"line_number":65,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a2ca52d_a91613a5","line":62,"in_reply_to":"7a2fa921_7ed95721","updated":"2015-10-15 12:48:11.000000000","message":"Thank you! This idea was mentioned to me in a pub a year ago so I didn\u0027t remember if there was already something to do this, but bbrecorder sounds perfect. I\u0027ll respin in terms of bbrecorder.","commit_id":"790412ec7a81ba69fedc63552e9b4e522eb6ea8e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"9f4254daf1a8d053e0abfa056e4128df0ece3ad3","unresolved":false,"context_lines":[{"line_number":68,"context_line":"logged at INFO or higher in the event of a failure (sometimes called FFDC,"},{"line_number":69,"context_line":"first failure data capture). Ultimately this is the best solution but it\u0027s a"},{"line_number":70,"context_line":"lot of work to achieve and it\u0027s unclear how long this effort will take to"},{"line_number":71,"context_line":"complete satisfactorily. In fact I\u0027m not sure if the LWG is still active."},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"Impact on Existing APIs"},{"line_number":74,"context_line":"-----------------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"7a2fa921_dea2eb98","line":71,"updated":"2015-10-08 20:07:17.000000000","message":"The working group is active, but has few developer resources to make the necessary changes. I agree, this is the best long-term approach.","commit_id":"790412ec7a81ba69fedc63552e9b4e522eb6ea8e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"9f4254daf1a8d053e0abfa056e4128df0ece3ad3","unresolved":false,"context_lines":[{"line_number":69,"context_line":"first failure data capture). Ultimately this is the best solution but it\u0027s a"},{"line_number":70,"context_line":"lot of work to achieve and it\u0027s unclear how long this effort will take to"},{"line_number":71,"context_line":"complete satisfactorily. In fact I\u0027m not sure if the LWG is still active."},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"Impact on Existing APIs"},{"line_number":74,"context_line":"-----------------------"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"7a2fa921_5ee49bdf","line":72,"updated":"2015-10-08 20:07:17.000000000","message":"Another alternative is to use the log configuration file to write debug logs to a destination that discards them more quickly (a file that is rotated more often, or a log stash database that is trimmed more aggressively, etc.).","commit_id":"790412ec7a81ba69fedc63552e9b4e522eb6ea8e"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"f46256aab52e3362401c4299e9121ac62c3710e8","unresolved":false,"context_lines":[{"line_number":69,"context_line":"first failure data capture). Ultimately this is the best solution but it\u0027s a"},{"line_number":70,"context_line":"lot of work to achieve and it\u0027s unclear how long this effort will take to"},{"line_number":71,"context_line":"complete satisfactorily. In fact I\u0027m not sure if the LWG is still active."},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"Impact on Existing APIs"},{"line_number":74,"context_line":"-----------------------"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a2ca52d_29d8c3ee","line":72,"in_reply_to":"7a2fa921_5ee49bdf","updated":"2015-10-15 12:48:11.000000000","message":"Happy to add this as an alternative","commit_id":"790412ec7a81ba69fedc63552e9b4e522eb6ea8e"},{"author":{"_account_id":1528,"name":"Stanislaw Pitucha","email":"viraptor@gmail.com","username":"stanislaw-pitucha"},"change_message_id":"52dd62f4ce783954c90e8ccc811037741e1db3ac","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"It\u0027s common to run logging at DEBUG, because if you run at anything higher,"},{"line_number":14,"context_line":"when a failure occurs you won\u0027t have enough information to diagnose the"},{"line_number":15,"context_line":"failure. What we really want is to run at at INFO usually and log at DEBUG only"},{"line_number":16,"context_line":"for those requests which fail. This spec describes a way to achieve this"},{"line_number":17,"context_line":"using `bbrecorder`_."},{"line_number":18,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_1be56b08","line":15,"range":{"start_line":15,"start_character":42,"end_line":15,"end_character":44},"updated":"2015-12-04 02:59:13.000000000","message":"atat?","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":1528,"name":"Stanislaw Pitucha","email":"viraptor@gmail.com","username":"stanislaw-pitucha"},"change_message_id":"52dd62f4ce783954c90e8ccc811037741e1db3ac","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Most of the time logs are output, stored, rotated and maybe even archived"},{"line_number":23,"context_line":"without ever being consulted. If you run at DEBUG, these logs can be enormous"},{"line_number":24,"context_line":"and processing can consume non-trivial amounts of resource. However, when you"},{"line_number":25,"context_line":"do need them, you absolutely need DEBUG logs."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Use Cases"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_fbce5f82","line":24,"range":{"start_line":24,"start_character":50,"end_line":24,"end_character":58},"updated":"2015-12-04 02:59:13.000000000","message":"resources","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":1528,"name":"Stanislaw Pitucha","email":"viraptor@gmail.com","username":"stanislaw-pitucha"},"change_message_id":"52dd62f4ce783954c90e8ccc811037741e1db3ac","unresolved":false,"context_lines":[{"line_number":25,"context_line":"do need them, you absolutely need DEBUG logs."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Use Cases"},{"line_number":28,"context_line":"----------"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"As a cloud administrator of Nova, a user has reported they cannot schedule VMs"},{"line_number":31,"context_line":"due to a NoValidHost error. I have to find their request in the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_bbc8d775","line":28,"range":{"start_line":28,"start_character":0,"end_line":28,"end_character":10},"updated":"2015-12-04 02:59:13.000000000","message":"align with section name?","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"651158669e71b739b2805a9c62148d71e975b85b","unresolved":false,"context_lines":[{"line_number":42,"context_line":"Proposed change"},{"line_number":43,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"This spec proposes offering an interface to `bbrecorder`_ from oslo.log."},{"line_number":46,"context_line":"This package provides a set of \u0027boxes\u0027 or log spools. If the request completes"},{"line_number":47,"context_line":"successfully, the box can be thrown away. If an exception would generate an"},{"line_number":48,"context_line":"HTTP 5xx response though, the \u0027crisis\u0027 function can be called and the log"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9a8ffd7b_365a302b","line":45,"updated":"2015-11-27 10:27:22.000000000","message":"bbrecorder supports python3.4 , not declare for supporting python 2.7 .","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"a4eb80ae414ee03c8b64783849c096ef44341432","unresolved":false,"context_lines":[{"line_number":42,"context_line":"Proposed change"},{"line_number":43,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"This spec proposes offering an interface to `bbrecorder`_ from oslo.log."},{"line_number":46,"context_line":"This package provides a set of \u0027boxes\u0027 or log spools. If the request completes"},{"line_number":47,"context_line":"successfully, the box can be thrown away. If an exception would generate an"},{"line_number":48,"context_line":"HTTP 5xx response though, the \u0027crisis\u0027 function can be called and the log"}],"source_content_type":"text/x-rst","patch_set":2,"id":"dab17558_900b567d","line":45,"in_reply_to":"7a740942_d426a6b9","updated":"2016-05-12 16:37:16.000000000","message":"The author has released under an OSI compatible license now (New BSD)","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"a4eb80ae414ee03c8b64783849c096ef44341432","unresolved":false,"context_lines":[{"line_number":42,"context_line":"Proposed change"},{"line_number":43,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"This spec proposes offering an interface to `bbrecorder`_ from oslo.log."},{"line_number":46,"context_line":"This package provides a set of \u0027boxes\u0027 or log spools. If the request completes"},{"line_number":47,"context_line":"successfully, the box can be thrown away. If an exception would generate an"},{"line_number":48,"context_line":"HTTP 5xx response though, the \u0027crisis\u0027 function can be called and the log"}],"source_content_type":"text/x-rst","patch_set":2,"id":"dab17558_5011eeae","line":45,"in_reply_to":"9a8ffd7b_365a302b","updated":"2016-05-12 16:37:16.000000000","message":"I\u0027ve sent the author a patch to fix this, let\u0027s see.","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"947c037ee78182275efbe5701412d337ab43bc7a","unresolved":false,"context_lines":[{"line_number":42,"context_line":"Proposed change"},{"line_number":43,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"This spec proposes offering an interface to `bbrecorder`_ from oslo.log."},{"line_number":46,"context_line":"This package provides a set of \u0027boxes\u0027 or log spools. If the request completes"},{"line_number":47,"context_line":"successfully, the box can be thrown away. If an exception would generate an"},{"line_number":48,"context_line":"HTTP 5xx response though, the \u0027crisis\u0027 function can be called and the log"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_d426a6b9","line":45,"in_reply_to":"9a8ffd7b_365a302b","updated":"2015-12-04 20:45:34.000000000","message":"When I recommended looking at bbrecorder, I hadn\u0027t checked the license. GPL v3 is not compatible with Apache, so we can\u0027t use it. http://git.openstack.org/cgit/openstack/requirements/tree/README.rst#n278\n\nUnfortunately, I think we\u0027re going to have to go back to your original plan of writing something ourselves.","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":1528,"name":"Stanislaw Pitucha","email":"viraptor@gmail.com","username":"stanislaw-pitucha"},"change_message_id":"52dd62f4ce783954c90e8ccc811037741e1db3ac","unresolved":false,"context_lines":[{"line_number":47,"context_line":"successfully, the box can be thrown away. If an exception would generate an"},{"line_number":48,"context_line":"HTTP 5xx response though, the \u0027crisis\u0027 function can be called and the log"},{"line_number":49,"context_line":"emitted. It is proposed these are written to a configurable location which"},{"line_number":50,"context_line":"defaults to ``/var/log/{service}/requests/`` using the request ID as the"},{"line_number":51,"context_line":"filename."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Specifically, a ``BlackBoxLogHandler`` class will be provided with the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_063bced2","line":50,"updated":"2015-12-04 02:59:13.000000000","message":"Is that a missing performance impact? Also, does it mean we\u0027re getting rid of easy way to grep for requests that happened around \"2015-12-01 12:15:*\" unless we\u0027re ready to scan all request logs? (this may be worked around by writing to \"DateTime-RequestId.log\")","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"a4eb80ae414ee03c8b64783849c096ef44341432","unresolved":false,"context_lines":[{"line_number":47,"context_line":"successfully, the box can be thrown away. If an exception would generate an"},{"line_number":48,"context_line":"HTTP 5xx response though, the \u0027crisis\u0027 function can be called and the log"},{"line_number":49,"context_line":"emitted. It is proposed these are written to a configurable location which"},{"line_number":50,"context_line":"defaults to ``/var/log/{service}/requests/`` using the request ID as the"},{"line_number":51,"context_line":"filename."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Specifically, a ``BlackBoxLogHandler`` class will be provided with the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"dab17558_701072a9","line":50,"in_reply_to":"7a740942_063bced2","updated":"2016-05-12 16:37:16.000000000","message":"Done","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"947c037ee78182275efbe5701412d337ab43bc7a","unresolved":false,"context_lines":[{"line_number":50,"context_line":"defaults to ``/var/log/{service}/requests/`` using the request ID as the"},{"line_number":51,"context_line":"filename."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Specifically, a ``BlackBoxLogHandler`` class will be provided with the"},{"line_number":54,"context_line":"following methods:"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"* ``set_size(mb)`` - the size in MB of the box"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_14baee23","line":53,"updated":"2015-12-04 20:45:34.000000000","message":"Rather than defining a handler, which can only write to a file, we could build another adapter layer that would buffer debug messages and only pass them to the configurable handler on demand. That would let us, for example, combine this with the syslog handler to send debug messages to syslog instead of just a file.","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"a4eb80ae414ee03c8b64783849c096ef44341432","unresolved":false,"context_lines":[{"line_number":50,"context_line":"defaults to ``/var/log/{service}/requests/`` using the request ID as the"},{"line_number":51,"context_line":"filename."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Specifically, a ``BlackBoxLogHandler`` class will be provided with the"},{"line_number":54,"context_line":"following methods:"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"* ``set_size(mb)`` - the size in MB of the box"}],"source_content_type":"text/x-rst","patch_set":2,"id":"dab17558_b022daff","line":53,"in_reply_to":"7a740942_14baee23","updated":"2016-05-12 16:37:16.000000000","message":"Done","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"651158669e71b739b2805a9c62148d71e975b85b","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"It\u0027s expected that many services will want to provide config options both to"},{"line_number":62,"context_line":"enable the feature and to make the box sizes configurable."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"Alternatives"},{"line_number":65,"context_line":"------------"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"9a8ffd7b_1c44eb18","line":63,"updated":"2015-11-27 10:27:22.000000000","message":"Shall we enable this function by default ?","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"a4eb80ae414ee03c8b64783849c096ef44341432","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"It\u0027s expected that many services will want to provide config options both to"},{"line_number":62,"context_line":"enable the feature and to make the box sizes configurable."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"Alternatives"},{"line_number":65,"context_line":"------------"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"dab17558_f01c62c3","line":63,"in_reply_to":"9a8ffd7b_1c44eb18","updated":"2016-05-12 16:37:16.000000000","message":"Nope, services will have to request blackboxes","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"947c037ee78182275efbe5701412d337ab43bc7a","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"The bbrecorder interface is richer, allowing multiple arbitrary subhandlers and"},{"line_number":80,"context_line":"a formatter to be provided. This spec proposes hiding them to promote an"},{"line_number":81,"context_line":"\"OpenStack Way\" but these functions could easily be exposed."},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"We could skip bbrecorder entirely and use standard Python logging to emit DEBUG"},{"line_number":84,"context_line":"level logs to a new file. This could be rotated more aggressively but will"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_d4d0e655","line":81,"updated":"2015-12-04 20:45:34.000000000","message":"I think a true production logging setup is going to want those sorts of features, but we don\u0027t have to build them ourselves if we put the new class at the right place in the logging object structure. I think that\u0027s the adapter, which ends up wrapped around every standard logger.","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":1528,"name":"Stanislaw Pitucha","email":"viraptor@gmail.com","username":"stanislaw-pitucha"},"change_message_id":"52dd62f4ce783954c90e8ccc811037741e1db3ac","unresolved":false,"context_lines":[{"line_number":105,"context_line":"DEBUG logs will be produced even if they\u0027re later thrown away. Users not"},{"line_number":106,"context_line":"currently logging at DEBUG who choose to enable this feature may see a small"},{"line_number":107,"context_line":"CPU impact."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"Configuration Impact"},{"line_number":110,"context_line":"--------------------"},{"line_number":111,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_a63c3a94","line":108,"updated":"2015-12-04 02:59:13.000000000","message":"What\u0027s the performance impact of creating new files -vs- appending lines to an open file? This may have non-zero impact on some filesystems.\n\nIt may also need a documentation entry about inode entries on a filesystem. A randomly selected drive I just checked has only 174k free inodes and \u003e400k used. I expect that\u0027s the order or magnitude of number of received requests on a serious system.","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":1528,"name":"Stanislaw Pitucha","email":"viraptor@gmail.com","username":"stanislaw-pitucha"},"change_message_id":"09b7da5d045852f6ab0147f88dbe3348cf0d8438","unresolved":false,"context_lines":[{"line_number":105,"context_line":"DEBUG logs will be produced even if they\u0027re later thrown away. Users not"},{"line_number":106,"context_line":"currently logging at DEBUG who choose to enable this feature may see a small"},{"line_number":107,"context_line":"CPU impact."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"Configuration Impact"},{"line_number":110,"context_line":"--------------------"},{"line_number":111,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_c6db861a","line":108,"in_reply_to":"7a740942_a63c3a94","updated":"2015-12-04 03:11:47.000000000","message":"Specifically, around ext2/3 time the mantra was: big files XFS, small files Reiser. Maybe it doesn\u0027t matter these days, but this should be at least mentioned, I think.","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":1528,"name":"Stanislaw Pitucha","email":"viraptor@gmail.com","username":"stanislaw-pitucha"},"change_message_id":"52dd62f4ce783954c90e8ccc811037741e1db3ac","unresolved":false,"context_lines":[{"line_number":109,"context_line":"Configuration Impact"},{"line_number":110,"context_line":"--------------------"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"Developer Impact"},{"line_number":115,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_064c2e41","line":112,"updated":"2015-12-04 02:59:13.000000000","message":"Should the default buffer size be available as config option? (maybe it\u0027s enough as a constant... just checking)","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"a4eb80ae414ee03c8b64783849c096ef44341432","unresolved":false,"context_lines":[{"line_number":109,"context_line":"Configuration Impact"},{"line_number":110,"context_line":"--------------------"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"Developer Impact"},{"line_number":115,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"dab17558_104e46c1","line":112,"in_reply_to":"7a740942_064c2e41","updated":"2016-05-12 16:37:16.000000000","message":"This will be configured by each service as they set up their blackboxes","commit_id":"11a150b1cdb525623b8d96376acaa4d63e4e8e72"}],"specs/newton/request-logs-on-failure.rst":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"e8fbbad0d484edcc82e93a7fc93f516df25ed3f4","unresolved":false,"context_lines":[{"line_number":50,"context_line":"SpoolManager will represent a set of spools. The SpoolLogger will cache log"},{"line_number":51,"context_line":"records until told to flush them, at which point it passes them to its parent"},{"line_number":52,"context_line":"logger. The usual trigger for a flush would be a failure to process the"},{"line_number":53,"context_line":"associated request."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"It\u0027s expected that one SpoolManager will be used for each type of request the"},{"line_number":56,"context_line":"service wants to process. For example, \u0027api\u0027 or \u0027scheduler\u0027. SpoolLoggers will"}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_e697d145","line":53,"updated":"2016-05-17 12:21:59.000000000","message":"How does the trigger cause the flush? A message logged to ERROR? An explicit call from an exception handler somewhere?","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"375404fe9d50b5fcfed11082bc4c4e48a28dbdb8","unresolved":false,"context_lines":[{"line_number":50,"context_line":"SpoolManager will represent a set of spools. The SpoolLogger will cache log"},{"line_number":51,"context_line":"records until told to flush them, at which point it passes them to its parent"},{"line_number":52,"context_line":"logger. The usual trigger for a flush would be a failure to process the"},{"line_number":53,"context_line":"associated request."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"It\u0027s expected that one SpoolManager will be used for each type of request the"},{"line_number":56,"context_line":"service wants to process. For example, \u0027api\u0027 or \u0027scheduler\u0027. SpoolLoggers will"}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_c93e1eb7","line":53,"in_reply_to":"dab17558_e697d145","updated":"2016-05-17 12:51:48.000000000","message":"I\u0027ve been more explicit about this. It\u0027s the last.","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"e8fbbad0d484edcc82e93a7fc93f516df25ed3f4","unresolved":false,"context_lines":[{"line_number":59,"context_line":"(\u0027spool.api\u0027, \u0027spool\u0027 then the root logger) may be. Importantly, this means"},{"line_number":60,"context_line":"that if a deployer chooses not to configure any of this, spooled log records"},{"line_number":61,"context_line":"will simply propagate to the root logger and thence to the root handlers,"},{"line_number":62,"context_line":"entering the main log."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"To control memory usage, each SpoolLogger will track its size in bytes and"},{"line_number":65,"context_line":"records. When a new record is offered, if either of these exceed the capacity"}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_a6fca972","line":62,"updated":"2016-05-17 12:21:59.000000000","message":"I wonder if it would be useful to build in tenant-id support early. So spool.api.request.\u003crequestid\u003e and spool.api.tenant.\u003ctenantid\u003e would hold related data.","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"375404fe9d50b5fcfed11082bc4c4e48a28dbdb8","unresolved":false,"context_lines":[{"line_number":59,"context_line":"(\u0027spool.api\u0027, \u0027spool\u0027 then the root logger) may be. Importantly, this means"},{"line_number":60,"context_line":"that if a deployer chooses not to configure any of this, spooled log records"},{"line_number":61,"context_line":"will simply propagate to the root logger and thence to the root handlers,"},{"line_number":62,"context_line":"entering the main log."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"To control memory usage, each SpoolLogger will track its size in bytes and"},{"line_number":65,"context_line":"records. When a new record is offered, if either of these exceed the capacity"}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_64011905","line":62,"in_reply_to":"dab17558_a6fca972","updated":"2016-05-17 12:51:48.000000000","message":"Do you have a use case in mind please? I\u0027m struggling to understand.","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"e8fbbad0d484edcc82e93a7fc93f516df25ed3f4","unresolved":false,"context_lines":[{"line_number":65,"context_line":"records. When a new record is offered, if either of these exceed the capacity"},{"line_number":66,"context_line":"configured on the logger\u0027s SpoolManager, it will immediately flush and raise an"},{"line_number":67,"context_line":"exception. Future work can add other types of limits and coping behaviours if"},{"line_number":68,"context_line":"necessary."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Services wishing to use spools will have to request them from oslo.log so"},{"line_number":71,"context_line":"this feature is implicitly off until services begin to take advantage of it."}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_06fdb5b0","line":68,"updated":"2016-05-17 12:21:59.000000000","message":"Why raise an exception?","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"375404fe9d50b5fcfed11082bc4c4e48a28dbdb8","unresolved":false,"context_lines":[{"line_number":65,"context_line":"records. When a new record is offered, if either of these exceed the capacity"},{"line_number":66,"context_line":"configured on the logger\u0027s SpoolManager, it will immediately flush and raise an"},{"line_number":67,"context_line":"exception. Future work can add other types of limits and coping behaviours if"},{"line_number":68,"context_line":"necessary."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Services wishing to use spools will have to request them from oslo.log so"},{"line_number":71,"context_line":"this feature is implicitly off until services begin to take advantage of it."}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_84107d01","line":68,"in_reply_to":"dab17558_06fdb5b0","updated":"2016-05-17 12:51:48.000000000","message":"I was assuming you set high limits and if the limit is exhausted, something has gone wrong, so you want to fail the request. Flushing quietly is probably a better option, on reflection, as although you might lose the filtering benefit of spooling, at least you\u0027re not failing requests! I\u0027ll wait for further feedback on this though, it may be worth making this configurable even in v1 so it\u0027s discoverable what the behaviour is.","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"e8fbbad0d484edcc82e93a7fc93f516df25ed3f4","unresolved":false,"context_lines":[{"line_number":115,"context_line":"Configuration Impact"},{"line_number":116,"context_line":"--------------------"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"None"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"Developer Impact"},{"line_number":121,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_8627e561","line":118,"updated":"2016-05-17 12:21:59.000000000","message":"Surely the deployer has some control over this behavior?","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"375404fe9d50b5fcfed11082bc4c4e48a28dbdb8","unresolved":false,"context_lines":[{"line_number":115,"context_line":"Configuration Impact"},{"line_number":116,"context_line":"--------------------"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"None"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"Developer Impact"},{"line_number":121,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_64d5991a","line":118,"in_reply_to":"dab17558_8627e561","updated":"2016-05-17 12:51:48.000000000","message":"Nope, it\u0027s up to services to request and configure spools so they\u0027re the ones that need to add config options. I\u0027ll explain.","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"e8fbbad0d484edcc82e93a7fc93f516df25ed3f4","unresolved":false,"context_lines":[{"line_number":120,"context_line":"Developer Impact"},{"line_number":121,"context_line":"----------------"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"None"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"Testing Impact"},{"line_number":126,"context_line":"--------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_061495e6","line":123,"updated":"2016-05-17 12:21:59.000000000","message":"Developers who want to use the new classes need to do so explicitly.","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"375404fe9d50b5fcfed11082bc4c4e48a28dbdb8","unresolved":false,"context_lines":[{"line_number":120,"context_line":"Developer Impact"},{"line_number":121,"context_line":"----------------"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"None"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"Testing Impact"},{"line_number":126,"context_line":"--------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"dab17558_24f0b1c8","line":123,"in_reply_to":"dab17558_061495e6","updated":"2016-05-17 12:51:48.000000000","message":"OK, didn\u0027t think that was worth mentioning, I\u0027ll add it.","commit_id":"92cc0d238a7b827fc62b9aecd66e147c4e0a80d6"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"8e8323c04656746fb84b5efb19f18cc10049555b","unresolved":false,"context_lines":[{"line_number":90,"context_line":"then uses the spool for all other logging. Let\u0027s say the request fails to"},{"line_number":91,"context_line":"schedule. A NoValidHostException is thrown which is caught by an exception"},{"line_number":92,"context_line":"handler. This handler calls ``flush`` on \u0027spool.scheduler.12345\u0027 and returns an"},{"line_number":93,"context_line":"error code to the API server, which calls ``flush`` on \u0027spool.api.12345\u0027."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"The logging configuration file has a handler on the \u0027spool\u0027 logger which"},{"line_number":96,"context_line":"catches these messages and writes them into a centralised logging system. To"}],"source_content_type":"text/x-rst","patch_set":6,"id":"bab6814e_e71d6b67","line":93,"updated":"2016-05-25 18:19:35.000000000","message":"I had some questions about usage that I posted to the ML thread about adding the spool to the context object: http://lists.openstack.org/pipermail/openstack-dev/2016-May/095948.html","commit_id":"66feb65fa27e9dc90bbaf3a3feafb26af9276eac"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"b9f680b454f113f7c1cd6c55d04b903135e52eeb","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"To control memory usage, each SpoolLogger will track its size in bytes and"},{"line_number":65,"context_line":"records. When a new record is offered, if either of these exceed the capacity"},{"line_number":66,"context_line":"configured on the logger\u0027s SpoolManager, it will immediately flush and raise an"},{"line_number":67,"context_line":"exception. Future work can add other types of limits and coping behaviours if"},{"line_number":68,"context_line":"necessary."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Integration and usage"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9abb7d3a_0830809d","line":67,"range":{"start_line":66,"start_character":71,"end_line":67,"end_character":10},"updated":"2016-05-31 10:32:59.000000000","message":"I\u0027d prefer to not raise an exception.\nI read your reply comment on this point in the PS #4, you assume that ppl set high limits and if that is exhausted something goes wrong, in my experience tuning these params it is always a bit tricky so it is easy to get it wrong at the beginning, I\u0027d prefer to flush silently and maybe emit some info for that but not raise an exception. Make it configurable it is a good option as well.","commit_id":"9a4599259b20287d8551c5b336b7dbe228530c79"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"8e4cad1ceb926e34fa35afa3c92bd6f20e392e14","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"To control memory usage, each SpoolLogger will track its size in bytes and"},{"line_number":65,"context_line":"records. When a new record is offered, if either of these exceed the capacity"},{"line_number":66,"context_line":"configured on the logger\u0027s SpoolManager, it will immediately flush and raise an"},{"line_number":67,"context_line":"exception. Future work can add other types of limits and coping behaviours if"},{"line_number":68,"context_line":"necessary."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Integration and usage"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9abb7d3a_1a70af0a","line":67,"range":{"start_line":66,"start_character":71,"end_line":67,"end_character":10},"in_reply_to":"9abb7d3a_0830809d","updated":"2016-05-31 13:57:32.000000000","message":"oops, yep, that is a mistake. It should say just flush now.","commit_id":"9a4599259b20287d8551c5b336b7dbe228530c79"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"d85203fe260041809768c106c860564f2fa29f57","unresolved":false,"context_lines":[{"line_number":205,"context_line":"None. It\u0027s up to services to request and configure spools so they\u0027re the ones"},{"line_number":206,"context_line":"that need to add config options. Most services will want options to enable"},{"line_number":207,"context_line":"spooling and configure the amount of memory consumed by each spool."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"Developer Impact"},{"line_number":210,"context_line":"----------------"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"9abb7d3a_e0412c3b","line":208,"updated":"2016-05-27 19:47:53.000000000","message":"It might be pretty useful to provide a really good example of how this works in docs as well so that consuming projects can know what the good pattern is to follow.","commit_id":"9a4599259b20287d8551c5b336b7dbe228530c79"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"8e4cad1ceb926e34fa35afa3c92bd6f20e392e14","unresolved":false,"context_lines":[{"line_number":205,"context_line":"None. It\u0027s up to services to request and configure spools so they\u0027re the ones"},{"line_number":206,"context_line":"that need to add config options. Most services will want options to enable"},{"line_number":207,"context_line":"spooling and configure the amount of memory consumed by each spool."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"Developer Impact"},{"line_number":210,"context_line":"----------------"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"9abb7d3a_9a4c9f9f","line":208,"in_reply_to":"9abb7d3a_e0412c3b","updated":"2016-05-31 13:57:32.000000000","message":"In docs? Like, openstack-manuals? Or do you just mean here? I\u0027ve given quite a lot of detail in the two \u0027integration\u0027 sections. and I was planning to do the at least the first implementation (in Nova) myself.","commit_id":"9a4599259b20287d8551c5b336b7dbe228530c79"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"473235353e070741e8379f79a900a0ed4fac2505","unresolved":false,"context_lines":[{"line_number":110,"context_line":"If the request had instead succeeded, then the API server would log the"},{"line_number":111,"context_line":"response (on the normal logger) and return, causing the last hard reference to"},{"line_number":112,"context_line":"the SpoolLogger to be lost. At some point the garbage collector would collect"},{"line_number":113,"context_line":"it and all the spooled messages."},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"Alternative integration"},{"line_number":116,"context_line":"-----------------------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7aa08908_cb38dcd5","line":113,"updated":"2016-06-08 16:32:57.000000000","message":"I\u0027m worried about relying solely on garbage collection. If a logger handle ends up sticking around somewhere, we might never reap it (a test suite or a closure might do that). Can we be more explicit here, and add a method to the spool manager to discard a given logger?","commit_id":"05acf758cff3be5fe3bce5699a7c5c8b34bac4bf"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"fba8c6e09f9db07fb298b90787a3bade8a6a6f15","unresolved":false,"context_lines":[{"line_number":110,"context_line":"If the request had instead succeeded, then the API server would log the"},{"line_number":111,"context_line":"response (on the normal logger) and return, causing the last hard reference to"},{"line_number":112,"context_line":"the SpoolLogger to be lost. At some point the garbage collector would collect"},{"line_number":113,"context_line":"it and all the spooled messages."},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"Alternative integration"},{"line_number":116,"context_line":"-----------------------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7aa08908_0e3ac0e7","line":113,"in_reply_to":"7aa08908_cb38dcd5","updated":"2016-06-09 15:10:03.000000000","message":"I take your concern. How about a method to clear a spool? So you either flush or clear on request termination, either way the bulk of memory is freed. The logger might hang about a bit but we can accrue a few tens of thousands of empty loggers before anyone will notice.","commit_id":"05acf758cff3be5fe3bce5699a7c5c8b34bac4bf"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"473235353e070741e8379f79a900a0ed4fac2505","unresolved":false,"context_lines":[{"line_number":121,"context_line":"manager would register the request ID as a certain type of request to be"},{"line_number":122,"context_line":"spooled. The filter would divert any records with a registered request ID to a"},{"line_number":123,"context_line":"spool. Leaving the context manager would cause the spool to be cleaned up, so"},{"line_number":124,"context_line":"if there is a failure, it would have to be flushed before then."},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"To elaborate on the flow, imagine there is a top-level API request processing"},{"line_number":127,"context_line":"method called ``nova.api.wsgi._process_request``. This receives the request,"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7aa08908_ebe0382b","line":124,"updated":"2016-06-08 16:32:57.000000000","message":"Do we ever have code used both inside and outside of a request context, such that in some cases it needs to use the spool and in other cases it should not? Can that code tell the difference?\n\nHow do we handle libraries? For example, when the API service talks to the scheduler, it does that through oslo.messaging. Will oslo.messaging have to be modified to take a spool logger argument? It can\u0027t really ask for one from the pool because it doesn\u0027t know whether to ask for the \"api\" or \"scheduler\" pool.\n\nDo we have the same problem with any other libraries?","commit_id":"05acf758cff3be5fe3bce5699a7c5c8b34bac4bf"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"fba8c6e09f9db07fb298b90787a3bade8a6a6f15","unresolved":false,"context_lines":[{"line_number":121,"context_line":"manager would register the request ID as a certain type of request to be"},{"line_number":122,"context_line":"spooled. The filter would divert any records with a registered request ID to a"},{"line_number":123,"context_line":"spool. Leaving the context manager would cause the spool to be cleaned up, so"},{"line_number":124,"context_line":"if there is a failure, it would have to be flushed before then."},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"To elaborate on the flow, imagine there is a top-level API request processing"},{"line_number":127,"context_line":"method called ``nova.api.wsgi._process_request``. This receives the request,"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7aa08908_a99e0661","line":124,"in_reply_to":"7aa08908_ebe0382b","updated":"2016-06-09 15:10:03.000000000","message":"There\u0027ll be a context, with a registered request ID, or there won\u0027t. According to that, with this \"alternative\" method, code will transparently do the right thing.\n\nLibraries - excellent point. Explicitly selecting a logger (the \u0027invasive\u0027 method) will cause library messages to default to the main log, while spooling from the root logger will cause them to get spooled. On balance I think the latter case is best, the library code is being called in aid of the request so it\u0027s 99% sure to be related. Library code should not be noticing odd things about your system state.\n\nI don\u0027t think we want to get into modifying all libraries OpenStack uses to take loggers, so this pushes me well over the line in finding the \"invasive\" method unacceptable.","commit_id":"05acf758cff3be5fe3bce5699a7c5c8b34bac4bf"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"473235353e070741e8379f79a900a0ed4fac2505","unresolved":false,"context_lines":[{"line_number":164,"context_line":"first failure data capture). Ultimately this is the best solution but it\u0027s a"},{"line_number":165,"context_line":"lot of work to achieve and it\u0027s unclear how long this effort will take to"},{"line_number":166,"context_line":"complete satisfactorily. Besides, caching log records is one way to achieve"},{"line_number":167,"context_line":"FFDC, see the scheduler use case."},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"We could use bbrecorder. This library offers a similar capability but with"},{"line_number":170,"context_line":"enough differences to make it unsuitable. It\u0027s based around a handler, not a"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7aa08908_6b3a889a","line":167,"updated":"2016-06-08 16:32:57.000000000","message":"Is it less work to do that than to go through all of the same code and ensure that it is using the right spool logger?","commit_id":"05acf758cff3be5fe3bce5699a7c5c8b34bac4bf"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"fba8c6e09f9db07fb298b90787a3bade8a6a6f15","unresolved":false,"context_lines":[{"line_number":164,"context_line":"first failure data capture). Ultimately this is the best solution but it\u0027s a"},{"line_number":165,"context_line":"lot of work to achieve and it\u0027s unclear how long this effort will take to"},{"line_number":166,"context_line":"complete satisfactorily. Besides, caching log records is one way to achieve"},{"line_number":167,"context_line":"FFDC, see the scheduler use case."},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"We could use bbrecorder. This library offers a similar capability but with"},{"line_number":170,"context_line":"enough differences to make it unsuitable. It\u0027s based around a handler, not a"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7aa08908_c97c32ee","line":167,"in_reply_to":"7aa08908_6b3a889a","updated":"2016-06-09 15:10:03.000000000","message":"Good FFDC requires you to understand a lot about the real situation, whereas picking the right logger would be time-consuming but easy. The \"alternative\" method should be far less work.","commit_id":"05acf758cff3be5fe3bce5699a7c5c8b34bac4bf"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"473235353e070741e8379f79a900a0ed4fac2505","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"None. It\u0027s up to services to request and configure spools so they\u0027re the ones"},{"line_number":206,"context_line":"that need to add config options. Most services will want options to enable"},{"line_number":207,"context_line":"spooling and configure the amount of memory consumed by each spool."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"Developer Impact"},{"line_number":210,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7aa08908_4b64ecb7","line":207,"updated":"2016-06-08 16:32:57.000000000","message":"What happens to existing spool loggers when the logging system is reconfigured while everything is still running?","commit_id":"05acf758cff3be5fe3bce5699a7c5c8b34bac4bf"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"fba8c6e09f9db07fb298b90787a3bade8a6a6f15","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"None. It\u0027s up to services to request and configure spools so they\u0027re the ones"},{"line_number":206,"context_line":"that need to add config options. Most services will want options to enable"},{"line_number":207,"context_line":"spooling and configure the amount of memory consumed by each spool."},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"Developer Impact"},{"line_number":210,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7aa08908_307b927d","line":207,"in_reply_to":"7aa08908_4b64ecb7","updated":"2016-06-09 15:10:03.000000000","message":"Nothing, really. The logging configuration mainly affects the levels of loggers and handlers, and which handlers are configured on which loggers. Whereas spools are set up by code and only interact via the root filter. Providing the root filter stays in place we should be good.","commit_id":"05acf758cff3be5fe3bce5699a7c5c8b34bac4bf"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"d4cf1a8bb33dd38bc80d946e8f80b501a26b570b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"  registered request ID to the correct SpoolLogger. This will be added to the"},{"line_number":62,"context_line":"  root logger by oslo.log logging setup."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"*SpoolContextManager*:"},{"line_number":65,"context_line":"  Wraps a section of code, registering a request ID for spooling on entry. On"},{"line_number":66,"context_line":"  exit, it will flush the spool if an exception was raised, otherwise clearing"},{"line_number":67,"context_line":"  it."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7aa08908_e7fb8779","line":64,"updated":"2016-06-13 13:34:00.000000000","message":"looks like this will just be a function, \u0027spooling\u0027","commit_id":"10e40f6733fe198ecc021afa4cdd35c75782e0db"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"2b9877a5a5305e196ada97055cde8e617c427a0d","unresolved":false,"context_lines":[{"line_number":87,"context_line":"then \"nova\" and finally hits the root logger."},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"At this point the SpoolFilter gets the record. It finds an associated request"},{"line_number":90,"context_line":"ID (either from the record extra dictionary or the context), gets the last"},{"line_number":91,"context_line":"spool registered for that request ID, sends the record there and returns False"},{"line_number":92,"context_line":"to prevent the root handlers emitting it. If there had been no associated"},{"line_number":93,"context_line":"request ID or spool (or the record was tagged - more on this later), the filter"},{"line_number":94,"context_line":"would return True to allow the handlers to proceed."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7aa08908_c70beb22","line":91,"range":{"start_line":90,"start_character":70,"end_line":91,"end_character":16},"updated":"2016-06-13 13:20:43.000000000","message":"this implies multiple spools can be registered, which is overcomplicated - change this language","commit_id":"10e40f6733fe198ecc021afa4cdd35c75782e0db"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"f301b8b90d0cfaa076f1cb65adf9a1a84b64c688","unresolved":false,"context_lines":[{"line_number":87,"context_line":"then \"nova\" and finally hits the root logger."},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"At this point the SpoolFilter gets the record. It finds an associated request"},{"line_number":90,"context_line":"ID (either from the record extra dictionary or the context), gets the last"},{"line_number":91,"context_line":"spool registered for that request ID, sends the record there and returns False"},{"line_number":92,"context_line":"to prevent the root handlers emitting it. If there had been no associated"},{"line_number":93,"context_line":"request ID or spool (or the record was tagged - more on this later), the filter"},{"line_number":94,"context_line":"would return True to allow the handlers to proceed."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7aa08908_c25ab9f1","line":91,"range":{"start_line":90,"start_character":70,"end_line":91,"end_character":16},"in_reply_to":"7aa08908_c70beb22","updated":"2016-06-13 16:06:06.000000000","message":"changed my mind, could be useful","commit_id":"10e40f6733fe198ecc021afa4cdd35c75782e0db"}]}
