LogPlugin: implement message saving. Small refactoring.