Replace error_log() with system logger + refactor system logger integrat...

...ion