Attach constants to the log via MDC

This can be merged back into the pull request for the conversation.