Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 SQL Agent log file rollover

Author  Topic 

dmaxj
Posting Yak Master

174 Posts

Posted - 2014-01-19 : 20:27:42
I have enabled verbose logging for an SQL Job related to transactional replication... The log file is starting to get rather large.

Is there a way to have the log file rollover once the log file reaches a certain size?

Regards

dmaxj
Posting Yak Master

174 Posts

Posted - 2014-02-05 : 11:32:25
Here is a short solution to this issue - POWERSHELL! I ran this script from an SQL Job to append a date and timestamp to the end of the log file.
The job runs once per day... Cheers...

$DateFileName = GET-DATE -FORMAT yyyy-MM-dd_hhmmss
Rename-Item <path>\<filename>.log -newname ("<filename>" + $DateFileName + ".log")
Go to Top of Page
   

- Advertisement -