Welcome to SqlServer-QA.net Sign in | Join | Help

SQL Server Storage Engine & Tools (SSQA.net)

SQL Server Tools includes storage engine that includes a complete set of graphical tools and command prompt utilities that allow users, programmers, and administrators. SSMS, SSRS, SSIS & SSAS are most commonly used tools.
Change SQLAgent log file location after SQL Server installation

Can we change the location of SQL agent error log file after the SQL Server program is installed?

Yes, in terms of configuring a specified number of SQL Server Agent error logs, this is not possible.  The default number of log files for SQLAGent is 9 that can be retained. On top of that if you want to log all the errors, warnings then you this can be configured for the type of messages (Errors, Warnings, Informational ) that are written to the SQL Server Agent error logs.  To do the same with TSQL you can use sp_set_sqlagent_properties which is an undocumented stored procedure by using @errorlogging_level clause to retain number of error logs. For the sake of changing the path for error log file you can use @errorlog_file input variable.

Whereas it is not possible to change main SQL Server error log location rather you can archive the logs older than so and so by using http://sqljunkies.com/Article/0DE35937-5475-4DC7-8490-C54A02143B24.scuk. and also set up a job to move the number of logs you wanted to.

Posted: Wednesday, July 11, 2007 2:17 AM by SQL Master

Comments

SSQA - SqlServer-QA.net said:

Can we change the location of SQL agent error log file after the SQL Server program is installed? Yes

# July 11, 2007 3:23 AM
Anonymous comments are disabled