Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    11

    Default Log names in /home/*/access-logs/* witch extention .log

    In /home/user/access-logs i have logs.

    Code:
    root@vi [/home/user/access-logs]# ls -l
    -rw-r----- 1 root user 0 Jan 20 14:01 index.user.anonimandia.pl
    -rw-r----- 1 root user 0 Jan 20 14:01 ns6.user.anonimandia.biz
    -rw-r----- 1 root user 0 Jan 20 14:01 plix2.user.anonimandia.org
    -rw-r----- 1 root user 0 Jan 20 14:01 user-pl.user.anonimandia.com.pl
    -rw-r----- 1 root user 0 Jan 20 14:01 user.anonimandia.eu
    Then i need to rotate them.

    So create:

    Code:
    root@vi [/home/user/access-logs]# cat /etc/logrotate.d/logs-user
    /home/user/access-logs/* {
    create
    missingok
    rotate 4
    compress
    weekly
    }
    and then i have horrible loop looking like tree .
    every log.gz is compressed many, many time:

    Code:
    access-logs/user/3ff.pl.3
    access-logs/user/3ff.user.anonimandia.pl
    access-logs/user/3ff.user.anonimandia.pl.1.gz
    access-logs/user/3ff.user.anonimandia.pl.1.gz.1.gz
    access-logs/user/3ff.user.anonimandia.pl.1.gz.1.gz.1.gz
    access-logs/user/3ff.user.anonimandia.pl.1.gz.1.gz.1.gz.1.gz
    access-logs/user/3ff.user.anonimandia.pl.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/3ff.user.anonimandia.pl.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/3ff.user.anonimandia.pl.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/3ff.user.anonimandia.pl.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/3ff.user.anonimandia.pl.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/3ff.user.anonimandia.pl.1.gz.2.gz
    access-logs/user/3ff.user.anonimandia.pl.2.gz
    access-logs/user/3ff.user.anonimandia.pl.3.1
    access-logs/user/bgt.user.biz
    access-logs/user/bgt.user.biz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    access-logs/user/bgt.user.biz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
    Most of them are empty.

    It happend, becouse
    Code:
    /etc/logrotate.d/logs-user
    contain:
    Code:
    /home/user/access-logs/*
    but should be:
    Code:
    /home/user/access-logs/*.log ( or exclude .gz )
    It can't be changed manually, or from template becouse stats is generating from hardcoded names.

    It would be perfect - if the name of logs have uniqe postfix.

  2. #2
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,891
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Log names in /home/*/access-logs/* witch extention .log

    In WHM > Service Configuration > cPanel Log Rotation Configuration, is where you would enable Log Rotation for access_logs.

    Files from /usr/local/cpanel/logs selected below will be rotated based upon their size. The rotated files will be compressed and stored in /usr/local/cpanel/logs/archive/. The files are named to include the month in which they are rotated. Consequently, the file names do not relate in any way to the content of the file being rotated. Files are only rotated when they grow larger than the WHM >> Tweak Settings >> Log Rotation Size Threshold or the default of 300MB. The archived log files are left in place indefinitely. Files not chosen here will not ever be rotated by cPanel software.
    Fav cPlinks this week: Blog - cPanel & WHM 11.32 we love it! | cPanel University study for it! | Attracta is coming! we want this!

  3. #3
    cPanel Staff
    Join Date
    Dec 2010
    Location
    ¯\_(ツ)_/¯
    Posts
    87
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Log names in /home/*/access-logs/* witch extention .log

    Be aware that /home/$user/access-logs is a symlink to /usr/local/apache/domlogs/$user/

    Accordingly, these logs are already automatically maintained by cpanellogd and rotated along with Web Statistics generation. If you are independently rotating these (like you're attempting to do) you stand to lose web stats information and cause other unexpected problems. This would be because you would be prematurely rotating logs outside of cPanel's expectations. Accordingly, I cannot recommend that you proceed with your current actions.

    As advised by Infopro, please utilize cPanel & WHM provided log rotation mechanisms to rotate these as desired.

    Just like Infopro has posted:

    WHM -> Tweak Settings
    Log rotation size threshold

    and the other various log configurations under that "Stats and Logs" tab. Those would be what you're looking for.

    Again, I cannot recommend pursuing the actions you're looking at since you would effectively be introducing two independent log rotation mechanisms and result in expected behavior, lost statistics, etc.

  4. #4
    Member
    Join Date
    Aug 2005
    Posts
    11

    Default Re: Log names in /home/*/access-logs/* witch extention .log

    True, and I know this options, but it is always last 300 MB.

    But i thing better idea is store last X month / weeks / days.

    Thank You for help

  5. #5
    cPanel Staff
    Join Date
    Dec 2010
    Location
    ¯\_(ツ)_/¯
    Posts
    87
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Log names in /home/*/access-logs/* witch extention .log

    If you're looking to archive logs, then that's an entirely different concept from the rotate option in Tweak Settings.

    Please see: Raw Access Logs

    Per that documentation, you can check the box:
    Archive logs in your home directory at the end of each stats run

    and archive domain logs for an account at /home/$user/logs/ after each statistics run. They will be in month-by-month archives stored as:

    /home/$user/logs/$domain-Month-Year.gz

    example:
    /home/brian/logs/mysite.com-Jan-2012.gz

    Note that the interval at which these log archives are updated is the same interval that you have set in "WHM -> Statistics Software Configuration" for Log Processing Frequency.

  6. #6
    Member
    Join Date
    Aug 2005
    Posts
    11

    Default Re: Log names in /home/*/access-logs/* witch extention .log

    Thank You

Similar Threads & Tags
Similar threads

  1. Filed with Developers Put logs into /var/log instead of /usr/local/cpanel/logs (Case 55969)
    By cPanelDavidG in forum Feature Requests for cPanel/WHM
    Replies: 33
    Last Post: 03-01-2012, 11:56 AM
  2. log of this in the general access log - "\x80s\x01\x03\x01"
    By jols in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-20-2010, 12:27 PM
  3. Viewing cpanel access log - other than downloading raw access log
    By bls24 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-11-2008, 02:46 PM
  4. log manager saving logs to home dir?
    By erinspice in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-28-2006, 11:10 PM
  5. log files not copied to domain home dir
    By tmallardi in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-09-2005, 02:02 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube