Sql-server – To Change the Log file location of SQL Server 2014 in AlwaysOn

availability-groupssql server 2014

I did not find a way how to change Always On Log file location.

AlwaysOn Logs are saved in

C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Log

Even in configuration is set like this:

SQLBACKUPDIR="F:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Backup"

; Default directory for the Database Engine user databases. 

SQLUSERDBDIR="D:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Data"

; Default directory for the Database Engine user database logs.

SQLUSERDBLOGDIR="E:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Data"

; Directory for Database Engine TempDB files. 

SQLTEMPDBDIR="E:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Data"

We had a problem now that log file was 40 GB and filled drive C and server crashed.
This is only for Always on logs, all other logs are where they should be.
Databases and everything is ok. Just log files of AO.

Any ideas how to change AlwaysOn Log file location?

Thanks

Best Answer

The Always on logs are written in the same location as the errorlog.

By moving the errorlog you can change this location. You will need to change the service startup parameter by opening the SQL Server configuration manager and changing the -e parameter and restarting the service.