Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Sep 21, 2014 6:15 pm 
Offline
Senior Newbie

Joined: Thu Sep 11, 2014 4:25 pm
Posts: 6
I'm using apache 2.2 on ubuntu 12.04. I set up the program rotatelogs to rotate my access log files on one of my virtual hosts. I followed the instructions I found here https://httpd.apache.org/docs/2.2/progr ... elogs.html

under the #Log file locations section in my virtual host config I originally had the following code:

Code:
CustomLog /home/user/public/mysite.com/log/access.log combined 


Per the instructions from the apache docs in the above link I changed this code to:

Code:
CustomLog "| /usr/sbin/rotatelogs /home/user/public/mysite.com/log/access.log.%Y-%m-%d 86400" combined


Now it worked perfectly the first night. I checked the log folder at like 12:30 am and there was indeed a new access log file created called access.log.2014-09-20 But when I checked the log folder just now there is no new access log file for today. So yeah there is no access.log.2014-09-21 in my log folder. It was my understanding that adding 86400 would result in the creation of daily logs at midnight.

Any ideas as to what could have caused the program to not make a new log?


Top
   
PostPosted: Sun Sep 21, 2014 7:43 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
I'm not familiar with doing log rotation this way, but looking at the docs a couple possibilities come to mind.

- All the examples don't have a space between the pipe symbol and the path to the program, while your configuration does. I don't know if this makes any difference or not.

- The rotation is done at midnight UTC rather than local time (unless you specify the -l option or an offset value, which you haven't). So it may be happening at a different time than you expect.


Top
   
PostPosted: Sun Sep 21, 2014 8:32 pm 
Offline
Senior Newbie

Joined: Thu Sep 11, 2014 4:25 pm
Posts: 6
Quote:
- The rotation is done at midnight UTC rather than local time (unless you specify the -l option or an offset value, which you haven't). So it may be happening at a different time than you expect.


You were right, it was the UTC time thing. For some reason I thought I was setting the time based on the server time zone or something. So the good news is that rotatelogs is working, it's just not working at the time I thought it would.
I'll look into adjusting the time with the -l option, etc.

Thanks.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group