added logging with log rotation