fixup #4179, improve logging system
Merge pull request #4227 from qunox/improvelogger

fixup #4179, improve logging system