Add logging to file

Fix wrong client name resolving