Changes for plugins.

Restructured the ErrorLog/Json, so that the ErrorLog can be used in
ErrorLog plugins.