Added logging, timestamp, and simple log rotation