Apache rotatelogs problems

Apache rotatelogs problems

Post by m.hoenev.. » Fri, 02 Feb 2001 21:45:44



I am running Apache 1.3.12 on a Solaris 8 machine.
The problem is that the sytem won't rotate my Apache Logfiles.

In httpd.conf I added the following line somewhere in the first
section of this file;

TransferLogs "|/usr/local/apache/bin/rotatelogs
/var/apache/logs/access_log 84600"

I restarted the server and watched it for some days nothing happened.

To test it I also experimented with smaller values of rotating but
without any success.

Does anyone have an idee for me.
Thanks for your time and help

Maurice Hoeneveld
System Engineering
HES Rotterdam, The Netherlands

 
 
 

Apache rotatelogs problems

Post by Robert Banniz » Sat, 03 Feb 2001 11:17:22


Try the following script (set variables to your own taste):

###########################################################
#!/bin/sh

# rotates webserver log files

DATE=`/bin/date +%m%d%Y_%H%M%S`
BASE_DIR='/var/log'
LOGS='httpd-access.log httpd-error.log httpd-referer.log'

for i in $LOGS; do
  if [ -f $BASE_DIR/$i ]; then
    /bin/cp $BASE_DIR/$i $BASE_DIR/$i.$DATE
    > $BASE_DIR/$i
    /usr/bin/gzip $BASE_DIR/$i.$DATE
  fi

  # search and delete older logs
  /usr/bin/find $BASE_DIR -name '$i.*' -a -mtime +30 -exec rm {} \;
done
###########################################################

Robert


> I am running Apache 1.3.12 on a Solaris 8 machine.
> The problem is that the sytem won't rotate my Apache Logfiles.

> In httpd.conf I added the following line somewhere in the first
> section of this file;

> TransferLogs "|/usr/local/apache/bin/rotatelogs
> /var/apache/logs/access_log 84600"

> I restarted the server and watched it for some days nothing happened.

> To test it I also experimented with smaller values of rotating but
> without any success.

> Does anyone have an idee for me.
> Thanks for your time and help

> Maurice Hoeneveld
> System Engineering
> HES Rotterdam, The Netherlands



 
 
 

1. Apache TransferLog with Apache::LogFile and rotatelogs catastrophy!

Hello,

Ok, I have this in my conf file:
PerlModule Apache::LogFile
PerlLogFile logs/urs.app_error_log My::URS::ERRLog
TransferLog "|/usr/local/apache/bin/rotatelogs
/usr/local/apache/logs/urs.app_error_log 3600"

When someone accesses the site, it logs the access_log information in
the custom log file I have up there, which I DO NOT want it to do.  If
i turn the TransferLog feature off, everything works fine.

What is going on and how do I fix it?

Thanks to all in advance,

Benjamin Elbirt

2. Diagnostic Software/Tools for Solaris

3. Apache's rotatelogs rotating files at 19:00 instead of 0:00

4. how to capture raw data from socket

5. apache rotatelogs: performance hit?

6. FreeBSD & NT/95 network

7. Apache 2.0.39 and Rotatelogs

8. .so -> .a ?

9. Apache, rotatelogs, and log ownership

10. apache rotatelogs monthly?

11. Apache, VirtualHosts, Logging to program (rotatelogs)

12. Apache rotatelogs question