prepare logging