Translated log files
The purpose of this enhancement is to enable OpenStack to generate secondary log files in a specified locale, different from the system's locale, in order to facilitate serviceability in a scenario where a customer runs OS in a language that support personnel may not understand, for example, Chinese customer and US dev/support team.
Blueprint information
- Status:
- Complete
- Approver:
- Mark McLoughlin
- Priority:
- Medium
- Drafter:
- Luis A. Garcia
- Direction:
- Approved
- Assignee:
- Luis A. Garcia
- Definition:
- Approved
- Series goal:
- Accepted for icehouse
- Implementation:
- Implemented
- Milestone target:
- 2014.1
- Started by
- Luis A. Garcia
- Completed by
- Luis A. Garcia
Related branches
Related bugs
Sprints
Whiteboard
Using the same strategy used for translated API responses described here https:/
The idea is to create a logging Handler, e.g. the TranslationHandler, which would work very similarly to how MemoryHandler works http://
MemoryHandler has a target handler (which can be any stream handler such as a FileHandler) and it buffers log messages before eventually flushing to the target handler. In the case of the TranslationHandler instead of "buffering" it would "translate" log Messages, before sending the output straight to its target handler.
Using this approach we would have a generic TranslationHandler that could be used as follows in a logging.conf file to create a secondary debug level log file in Chinese, while the default could be info level in English:
[handlers]
keys = production, secondary-logfile, translator
....
[handler_
class = handlers.
level=DEBUG
args = ('/var/
formatter = context
[handler_
class = nova.openstack.
target = secondary-logfile
args = ('zh_CN',)
---
Current patches:
https:/
Addressed by: https:/
New translated log handler
Addressed by: https:/
Enable setting up translation handler via CONF
Addressed by: https:/
Add support for zh locales missing from babel
Work Items
Work items:
- Enable secondary log via additional log handler: DONE
- Enable secondary log via quick config property (e.g. similar to log-file): TODO