rework logging and add SSH support