The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

The access logs shows only last hour...

Discussion in 'General Discussion' started by postcd, Oct 10, 2014.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    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
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, but deleting the files on a cron job is not advised because you could remove data before statistics are generated from them.

    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.
     
  5. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    /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?

    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..
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  7. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    because i need to keep them for a month, stats run is more frequent
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, you must leave that option enabled as the two are connected.

    Thank you.
     
  9. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    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
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  11. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    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:
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page