improved logging process