News:

SMF - Just Installed!

Main Menu

How to keep/store logs for years in Plesk for Windows?

Started by Administrator, Dec 29, 2022, 07:51 AM

Previous topic - Next topic

Administrator

Question
My country's legislation require storing all server logs for an extended period of time. How to store/keep website logs for years in Plesk for Windows?
Answer
Quotenswer
Plesk recommends that you do not disable log rotation and do not store log files for a long time because it may cause excessive disk space usage and decrease server performance
QuoteKeep in mind that removing a website in Plesk also removes all its logs. To avoid this, store required log files in a remote/external storage or in a database. You can use third-party log management software or follow the instructions below.
QuoteExposing the IP addresses in logs and storing any personal/business data contradicts the GDPR requirements. By using these instructions, you accept the possibility of violating one or more GDPR clauses.
Note: the instructions only cover server logs rotated by Plesk, namely:
  • Client website HTTP/ModSecurity/PHP logs
  • FTP logs
  • Mail logs
  • Plesk-related logs
Server logs that are not rotated by Plesk are not covered. A separate solution should be implemented on your side to store these logs.
To store logs for an extended period of time, do the following:
  • . To preserve sensitive data, disable IP addresses anonymization in Plesk. Go to Tools&Settings > Server Settings (under "General Settings"). Clear the "Disable IP logging in IIS, FTP, and mail logs" checkbox, and then click OK:
  • Open Registry Editor in Windows by typing regedit in the search box on the taskbar, then select Registry Editor (Desktop app) from the results.
  • Configure the following keys:
    • Client website HTTP/ModSecurity/PHP logs storage configuration example:
      REG ADD "HKLM\SOFTWARE\PLESK\PSA Config\Config" /v SaveHTTPLogsDirectory /t REG_SZ /d "path to directory" /reg:32 /f
    • FTP logs storage configuration example:
      REG ADD "HKLM\SOFTWARE\PLESK\PSA Config\Config" /v SaveFTPLogsDirectory /t REG_SZ /d "path to directory" /reg:32 /f
    • Mail logs storage configuration example:
      REG ADD "HKLM\SOFTWARE\PLESK\PSA Config\Config" /v SaveMailLogsDirectory /t REG_SZ /d "path to directory" /reg:32 /f
    • Plesk logs storage configuration example (available starting from Plesk for Windows 18.0.46 version):
      REG ADD "HKLM\SOFTWARE\PLESK\PSA Config\Config" /v SavePleskLogsDirectory /t REG_SZ /d "path to directory" /reg:32 /f
where "path to directory" is the remote/mounted storage path.
After that, logs will be copied to the specified log storage at the time of log rotation. To configure log rotation in Plesk, follow these instructions.