Format logging for csv and database import.