improved system log, now also catching shutdown messages, cleaned code