Sql-server – SQL Server created a new errorlog file but instance and agent were not restarted

error logsql serversql-server-2012

One of our jobs failed but the job history had already expired by the time we investigated. We could, however, see that a new log file was created around the time it failed.

There was no instance restart (checked os_sys_info) or agent restart (looked in sys.processes) and nobody using it knows how to cycle the log.

Must it have been a corruption of some kind?

Best Answer

I would assume it's more likely that the procedure sp_cycle_errorlog was called. There's a possibility someone accidentally right clicked on Error Log and then clicked Recycle instead of Configure which also calls this procedure.

What I would do is create an audit event on this procedure for the future so you can see how this occurs. If you do have some SQL Auditing in place, I'd search the history to see if that procedure was caught in the audit.

Jeremiah Peschka from Brent Ozar on the log recycling.