added encoding to logmessage