Add extra logging
Add tread ID to logged messages