Fix PrettyException middleware when custom log defined