better IP detection and multi log output