working logging code