logging hook handler