Client access.log ends at midnight

  • Hello,


    one of my clients asked me why his Apache log files (access.log) in his directory
    /logs are always start in the morning, ca. 6.30 , but they end at midnight 23.59 .


    I investigated this and found that the cronjob
    ("/var/www/imscp/engine/tools/imscp-httpd-logs-mngr")
    which seems doing the copy from /var/log/apache/... to users /logs directory is
    set to run "@daily", which means at midnight.
    But the system log rotate for Apache log files is done in the morning, 6.30 (+-).


    This explains why the time from midnight to 6.30 is always missing.


    How can i solve this?



    Kind regards



    System is :
    i-MSCP 1.2.2
    Ubuntu 14.04.2, kernel 3.13.0-53-generic
    Apache 2.4.7-1ubuntu4.4
    PHP 5.5.9-1ubuntu4.9 , Zend Engine v2.5.0 , ionCube PHP Loader + Intrusion Protection v5.0.7, Zend OPcache v7.0.3
    Perl v5.18.2 built for x86_64-linux-gnu-thread-multi

  • @harry15


    Will be fixed in a next release by removing the cronjob and replacing it by a bind mount. Then, log will be always up-to-date. For now, the only way is to change time at which the cron job is run.



    For instance, by removing the cronjob and using bind mount


    Shell-Script
    1. # cd /var/www/virtual/test.tld/logs# rm ./*# touch access.log# chown vu2003:vu2003 access.log# mount -B /var/log/apache2/test.tld/access.log /var/www/virtual/test.tld/logs/access.log


    RESULT


    Shell-Script
    1. root@wheezy:/var/www/virtual/test.tld/logs# mount |grep /var/www/virtual/test.tld/logs/access.log/dev/disk/by-uuid/fa1f447c-9cce-47cf-ae20-a1babcf3db7c on /var/www/virtual/test.tld/logs/access.log type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)


    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Re;


    Will be fixed in version 1.2.9 ;) Already fixed in my local repository. Tests are in progress ;)


    Involved changes:

    • Changed: Customers have now a full access to their httpds logs, including those which were rotated
    • Changed: Domains's logs are now mounted in customers's logs folder using bind mount instead of being copied
    • Fixed: Due to logs rotation, some httpd logs are never copied into customers's logs folder

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206