Modified logging procedure. For more data collection.