To shrink the database log file automatically, follow the given steps: 1. Open the SQL Server Management Studio and connect the server. Now, move to Object Explorer. 2 Subsequently, choose the log file to shrink. Right-click and select Tasks, choose Shrink, and click File. 3. In the next window, set Log as the file type, specify a name, and choose shrink action. Finally, click OK.