Hello this is Mike Janulaitis founder of Corner Bowl Software. In this article I am going to show you how to backup IIS log files to a central location while also deleting old log files that are no longer needed with Corner Bowl Event Log Manager 2021.
How to
To accomplish this task, we must create and assign a new Text Log Backup Template.
Select File -> New. Expand Template, then Log Management then click Log Backup.
From the New Template view, find the Sub-Type drop-down then select Text Log.
From the General tab specify a friendly name such as Backup IIS Log Files.
Since IIS generates a log per day by default, the default schedule of Daily is appropriate.
General options for backing up and centralizing IIS log file
Select the Logs tab then navigate to the latest log file.
Once selected, modify the Search Criteria to specify the current date. For example:
D:\Web_Logs\WebSite01\W3SVC8\u_ex<yyMMdd>.log
If I click the Test button we can see the current file.
Assign IIS log files to backup and centralize
Click the Add button.
Next click the Options tab.
Use the Filename text box to specify the central location to save the log files.
Notice the use of TAGS {HOST} {LOG} {DATE} and {TIME}.
Since IIS log files have the date embedded in the file name, there is no need to use the DATE and TIME tags.
If I change the output to: 'D:\Web_Logs\Backup\{HOST}\{LOG}' a directory will be created for each host I assign this template too.
The {LOG} tag tells the software to backup the IIS log file with the same filename.
If I choose to compress to ZIP, the IIS log file is compressed to the same filename but with the .zip extension in place of the .log extension.
If you like you have the option to encrypt and digitally sign the files.
Next we have the option to delete the file that was backed up. I want to leave 15 days of logs on the server so I'm going to leave this option off.
Next I would like to only leave 15 days of log entries on the web server so I'm going to check the 'Delete files in the source directory' option then set the number of days to 15.
Next I am going to choose to only retain 90 days of logs in the central location so I'm going to check the 'Delete files in the destination directory' option then set the number of days to 90.
Finally, I need to tell the software to backup the previous day's log rather than the current log because it is still being populated with current events.
To do this I need to check the 'Backup yesterday's file or path' option.
Once I have completed the configuration, I must still assign each server which I would like to backup the IIS log files from.
Since I only selected a file from my localhost we can see the local host is already assigned in the assigned Hosts list.
Use the hosts drop-down to assign other servers.
IIS log file backup options screenshot
Click Close and save your changes.
Next I want to show you this in action so I'm going to manually execute this template on my localhost.
From the Explorer view navigate to the target host, expand, find the new template, right click and select Execute Verbose.
The Host Template Status view displays and we can see the results.
Once complete we can see many old files that were deleted from the source server.
Once this template runs for more than 90 days, old files will be deleted from the central IIS log repository.
If I open Windows Explorer we can see the backed up file compressed in ZIP format.
That's IIS log file backup and centralization with Corner Bowl Event Log Manager.