[LogFiles] Archive
This is a specific task-driven module. It combines several steps into one that would otherwise require you to build the same functionality out of several steps with other base modules. Its primary focus is providing a quick way for managing an archive of logfiles. While we focus on logfiles here, it certainly could be used on any type of collection of files that you would want to handle in the same manner.
The module will archive logfiles, with the option to use a different folder for the archive from the source. When a logfile is archived, it is moved into a compressed destination file, meaning the original raw logfile is removed once it is successfully archived. The module allows you to optionally use the compression grouping features similar as to what is found in the [Files] Compress module for the compressed archive file(s). Then, after processing all those options, it also can automatically prune the archived .zip files to a certain age range. This bundles a lot of functionality all into one module while keeping the number of parameters to a minimum for the common task of managing application logfiles.
The parameters that the module uses are detailed in the following table.
| Parameter | I/O | Description |
|---|---|---|
| FileSource | In | This parameter specifies the source of the logfiles as a FileList type of parameter. As a FileList, this can be specified as just the path for a specific folder. Or it can be specified as the path to a folder with a filename pattern to limit it to specific types of filenames or extensions. Or it can be linked to a preceding [Files] Find module for more flexibility in choosing what files to manage. Examples of the prior might look like one of the following: C:\inetpub\logs\LogFiles\W3SVC1, D:\websites\example_com\logs\*.log |
| ArchiveFolder | In | Logfiles can be archived to the same folder as the source, but if you use the purge option with it, it will potentially remove any other compressed .zip files found in the source folder. Therefore, we recommend for maximum flexibility, the archive folder should be separate from the source. A common practice for the first example from the example above: C:\inetpub\logs\LogFiles\W3SVC1\Archive |
| CompressionGrouping | In | None: Creates one destination zip file for each source file, with the same name as the source file, plus a ".zip" extension. Timestamp: Compresses all files to a single file named Hour: Compresses all files to a single file named Day: Compresses all files to a single file named Week: Compresses all files to a single file named Month: Compresses all files to a single file named Quarter: Compresses all files to a single file named Year: Compresses all files to a single file named See the table in the [Files] Compress module for more details. |
| FilePrefix | In | The file prefix is added to the destination filename of the archive file. This is used in conjunction with the compression grouping feature and more examples of how it can be used can be found in the [Files] Compress module documentation. |
| PurgeOldArchiveFiles | In | True: After the archiving is completed, the module looks for any .zip compressed files in the archive location and deletes them if they exceed the age threshold set below. Note: it is important to make sure if a separate archive folder is not specified, this can have the side effect of deleting .zip files from the file source. False (default): No purging is done. |
| PurgeAgeThresholdValue | In | The automatic purge of old logfile archives can range from a specified number of minutes, to a number of months. The value should be set to an integer value of the duration you want to keep archive files for. |
| PurgeAgeThresholdUnits | In | The automatic purge of old logfile archives uses this parameter to define the actual range of the duration that the purge works within. As an example, if you wanted to keep archive files for up to 20 weeks, the previous parameters value would be set to 20 and this parameter would be set to “Weeks”. |
| LogOutputLevel | In | Minimal: Normal output to the log. Verbose: More detailed output is written to the log, suitable for debugging purposes. |
| SourceFilesArchived | Out | The module provides a FileList of the files that were provided as input on the source which were able to be successfully archived. Because the files in this list were archived, they would no longer be found at the specified location, meaning this FileList would just be informational in nature. |
| ArchiveFilesPurged | Out | The module provides a FileList of the files that aged out using the automatic purge option for the archive files. Because this is a list of files that have now been removed, this FileList would just be informational in nature. |
| FileList | Out | The output from this parameter is the FileList of archive files that have been created or updated during this run of the module. |