The access logs shows only last hour...

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Hello,

i see in /usr/local/apache/domlogs folder, the access log files for each domain has oldest entries not even one hour old..

how i can see older entries or some workaround to keep them on server? Thank you
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
Hello :)

You will need to disable the following option in "Tweak Settings" under the "Stats and Logs" tab:

"Delete each domain’s access logs after stats run"

Keep in mind this will utilize more disk space because the log files are not deleted after the statistics generation. The other option is to leave this enabled, and instead utilize the "Archive logs in the user's home directory at the end of each stats run unless configured by the user" option.

Thank you.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Thanks for helpfull reply, (its great how good memory and skill you got)

please kindly advice me more regarding this issue. In Tweak settings are options:

1) Option: "Delete each domain’s access logs after stats run"

when i turn off this, it means /usr/local/apache/domlogs log files will be growing indefinatelly and i need to setup some tmpwatch on that folder?

2) Option: "Archive logs in the user's home directory at the end of each stats run unless configured by the user."

When i turn off this log archiving into user accounts, will WHM auto delete already existing log files from all accounts? Or i need to setup some command/script to delete it? I found some accounts have files of total 100mb+ in /home/username/log and they are older than X months.

Thx
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
Option: "Delete each domain’s access logs after stats run"

when i turn off this, it means /usr/local/apache/domlogs log files will be growing indefinatelly and i need to setup some tmpwatch on that folder?
Yes, but deleting the files on a cron job is not advised because you could remove data before statistics are generated from them.

Option: "Archive logs in the user's home directory at the end of each stats run unless configured by the user."

When i turn off this log archiving into user accounts, will WHM auto delete already existing log files from all accounts? Or i need to setup some command/script to delete it? I found some accounts have files of total 100mb+ in /home/username/log and they are older than X months.
You have to enable "Remove the previous month's archived logs from the user's home directory at the end of each month unless configured by the user" if you want the previous month's archived logs removed. Note that users can override these options by configuring their own log archiving preferences.

Thank you.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
deleting the files on a cron job is not advised because you could remove data before statistics are generated from them.
/usr/local/apache/domlogs are used for this generation, for which generation? or any idea how to trim these files (how many days need to be kept?

You have to enable "Remove the previous month's archived logs from the user's home directory at the end of each month unless configured by the user"
This option is grayed out when "Archive logs in the user's home directory at the end of each stats run unless configured by the user." is disabled..
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
The Apache domlogs are used for statistics generations (Awstats, Webalizer, etc). I'm not sure I fully understand your question. If you prefer to trim them, why not just enable "Delete each domain’s access logs after stats run"?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
This option is grayed out when "Archive logs in the user's home directory at the end of each stats run unless configured by the user." is disabled..
Yes, you must leave that option enabled as the two are connected.

Thank you.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
I dont want to keep either enabled as per reasons i mentioned. But i asked how then i need to trim or delete domlogs access logs so it dont affect whm
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
I dont want to keep either enabled as per reasons i mentioned. But i asked how then i need to trim or delete domlogs access logs so it dont affect whm
The best way to do this is to enable "Delete each domain’s access logs after stats run". You could disable that option and empty the log files manually (e.g. with a rm or echo command), but remember the data that's removed before the next statistics generation is not included in the statistics applications such as Awstats or Webalizer.

Thank you.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Thx, will be there any error if i delete all files & folders from /usr/local/apache/domlogs ?

Example adding file to /etc/cron.monthly with content:
# delete domlogs contents which are older 45 days
/bin/nice -n 19 tmpwatch -m 1080 /usr/local/apache/domlogs
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
You should empty the files with an "echo "" >" command instead of removing them, and keep in mind it's not recommended because you will lose some statistics data by doing so.

Thank you.