Added extensive logging support