Logging improvements