Creates log files and sends error emails only in production environment