fixup #4179, improve logging system