How to limit log file size using Cyberpanel?

Hi,

I’m using CyberPanel with Litespeed Enterprise. I created a website using CyberPanel and defined the custom log destination using vhost.

Currently the logsize seems to be limited to 2 GB (per default). After it reaches 2 GB the old file gets archived and a new log file gets created.

Now I would like to decrease the file size limit to 100 MB. While there are corresponding settings in Litespeed Enterprise, they are not working because the website was created in CyberPanel.

I then tried to add to the vhost file of the CyberPanel website:

<VirtualHost *:443>
...
CustomLog /logs/access_log combined
<IfModule litespeed>
LogRotationSize 100M
</IfModule>

… but this also doesn’t seem to work. :thinking:

What can I do to decrease the file size limit of my log files from 2 GB down to 100 MB?

Thanks!

after every 10 mbs the file created a new log file but you have to clean these files menuly

Thanks for your answer, but that wasn’t the question. And in my case only after 2 GB a new file gets created, not after 10 MB. Therefore I would like to decrease the size. Doesn’t have to be 10 MB (too many files), but 100 MB or something like that would be nice.

  1. Go to Server Configuration → Log and set Rolling Size (bytes) to 100MB it specifies when the current log file needs to be rolled over. When the file size is over the rollover limit, the active log file will be renamed and a new active log file will be created. The actual size of the rotated log file once it is created will sometimes be a little bigger than this size limit. This principle also applies to access.log

  2. Change keepDays to 1 only rotated log files older than the specified number of days will be deleted. You can also do it another way by inserting keepDays 1 to /usr/local/lsws/conf/httpd_config.conf in respective section.

  3. Choose to compress log files. this will compress rotated files. LS says they are highly compressed.

That sounds great and would be exactly what I’m looking for but it doesn’t seem to work for websites created with CyberPanel.