Add logging functionality