You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close

Looking for the Diagnostic Utility?

Click Here For Download and Usage Instructions

PortalGuard Log Rotation and Log Clean-up


Problem

  1. Your PortalGuard server is running low on disk space -OR-
  2. Your PortalGuard server has run out of disk space -OR-
  3. Prior days' PortalGuard run-time logs are gathering in the "Logs" folder.

Solution

Low disk space on the drive where PortalGuard writes its run-time logs can become a problem if you leave the Log Level in PG_Config.exe or IdP_Config.exe set to "Trace" for an extended period of time (e.g. weeks or months). This can crash your PG server so do NOT let this happen to you! Please see our other KB on how to modify these Log Level settings.

To combat this, PortalGuard has a specific process responsible for moving prior days' logs out of the base "Logs" folder into the "Logs\old" folder. More importantly this process also deletes log files from the "Logs\old" directory older than a configurable threshold (default of 30 days). When enabled, the Log_Rotation.exe process runs as a daily scheduled task. The information below details how to ensure this is setup and configure it to your liking.

One of the first things you absolutely must do after installing PortalGuard is run its Initial Setup. You only need to do this once, but running it multiple times will not have adverse effects. 

  1. On the PortalGuard Server, navigate to the PortalGuard Configuration Editor and click on the 'Actions'menu:
    • PortalGuard Config - Actions Menu
  2. Once in the Actions menu, select 'Initial Setup':
    • PortalGuard Config - Initial Setup
  3. A new window will open.  Click the 'Start' button:
    • PortalGuard Config - Initial Setup Start
  4. NOTE: You will only see the dialog below If you have already run the Initial Setup. Since you do not have Log Rotation enabled, you will most likely NOT see it. However, if you do see it, click 'No' (the 'safer' option) to keep the logging data in the existing PortalGuard Windows Event Log. If, however, you want to delete & recreate the PortalGuard Event Log, then click 'Yes' :
    • PortalGuard Config - Initial Setup: Logs Prompt
  5. The 3rd and final task of Initial Setup is a request to enable Password Expiration Reminder Emails. If you are seeing this prompt, that means you do NOT already have them enabled so you should absolutely click 'No'! Details on that feature are in a different, less fun KBStay on task, stick with this KB about log rotation and click 'No' on the dialog below!
  6. As mentioned above, by default, the Log Rotation will delete any files from the "Logs\old" directory that are older than 30 days. If you would like to change this threshold, launch a text editor (like Notepad++) as an administrator.
  7.  Open the following file: C:\Program Files\PistolStar\PortalGuard\bin\LogRotation.exe.config
    • NOTE: If you do not see this file, then you have an older version of PortalGuard. You must:
      • Download the updated LogRotation.exe (v1.0.0.1) from this box.com URL
      • "Unblock" the zip file (right-click it, Properties -> then the "Unblock button or checkbox)
      • In the C:\Program Files\PistolStar\PortalGuard\bin folder,rename the existing "LogRotation.exe" to "LogRotation.old"
      • Copy the newer LogRotation.exe and LogRotation.exe.config into this folder.
  8. In the LogRotation.exe.config file, change the "DaysToKeep" value from "30" (as shown below) to the number of days of logs you wish to archive/keep.
    • NOTE: This is a "string" value so make sure you do not accidentally delete the double-quotes surround the value!
  9. Save the changes to that file and close the text editor.

With those steps done, the Log Rotation will automatically occur at 6am tomorrow morning (and the next, and the next...). If you are low on disk space now and want to run the clean up immediately, do the following:

  1. From the Start button, open Windows Task Scheduler 
  2. In the "Task Scheduler Library" folder, click/select the PortalGuard Log Rotation task (note how it is set to run every morning at 6:00 AM).
  3. Click the "Run" action on the right-hand side to run it immediately.
  4. Verify the older log files have been deleted from the following folder: C:\Program Files\PistolStar\PortalGuard\Logs\old
    • NOTE: There will be a maximum of 60 log files since each day has separate PG_Log and IdP_Log files!

If you run into any errors or have questions, please email us at techsupport@portalguard.com.

REV. 01/2020 | PortalGuard

  • 119
  • 24-Jan-2020
  • 191 Views