Add message IDs for log messages

Registered by Ying Chun Guo

In icehouse design summit, there is a session to discuss messages i18n policies. One follow up action is to add messages IDs to log messages, in order to enable searchability.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Implementing: Generated message IDs -- went over work happening to generate message IDs
 - MD5SUM from message text, frozen at code freeze, put into catalog as message property. Then next release use same message to rename
   - but we also want the source line # included (so it's unique) (or a random # to salt it), module name is also available
 - prefix Nova messages with something

Peng Wu - Thu Mar 6 2014

Message ID Generation

Purpose

The Rest response message and log message will be translated to ease people usin
g openstack.
But when some bug happens, the developer maybe not read the translated message,
so a message ID is required to find the corresponding English message in the sou
rce code.

Requirement

*. the message id should be consistent across openstack versions.
*. the message id may provide the same ID with trivial changes.

Proposals

*. filename#methodname#lineno
   *. can't be consistent across openstack version.
*. md5sum
   *. this message id is a bit long.
   *. will change greatly with trivial changes.

Second Thoughts

Actually we don't have a solution to meet all above requirements.

After read the code of common/gettextutils.py in oslo-incubator project [1],
I think the member variable msgtext already stores an English message, and when required the saved original message will be translated before returned from the server.

So we have both English and translated message now, how about we return both for Rest response message and log message?
Then users can read translated message. When he encounters a bug, the developer can require the English version to read.
Then we can avoid the introduction of message ID generation, as the requirements are hard to meet all.

Refer URL:
[1] https://blueprints.launchpad.net/oslo/+spec/log-messages-translation-domain

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.