logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: RotateLogs in apache httpd, logfile name should be satic
Author
jnsunkersett



Joined: 30 Jan 2011
Posts: 23

PostPosted: Sat 24 Sep '11 11:21    Post subject: RotateLogs in apache httpd, logfile name should be satic Reply with quote

Hi,

I use Apache HTTPD, as a front to my Jboss app-server on a windows O.S

In the CustomLog directive, I am using the the rotateLogs.exe provided with httpd.

Now instead of a single massive access.log, I get new files being generated every day (every 86400 secs), but cannot decipher the naming convention of the log file;

ols.access.log.1316736000, was generated yesterday
ols.access.log.1316822400 was generated today.

Is it possible to have the log file name, static and after every configured interval, the logs gets backedup into a new file.
Similar to Log4J's DailyRollingFileAppender.

thank you
jeevan
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Sat 24 Sep '11 12:30    Post subject: Reply with quote

You can define that using %

e.g.
%Y.%m.%d.ols.acess.log


See the manual for that.

http://httpd.apache.org/docs/current/programs/rotatelogs.html#examples

If you still have a question pleae ask again
Back to top
jnsunkersett



Joined: 30 Jan 2011
Posts: 23

PostPosted: Sun 25 Sep '11 11:55    Post subject: Reply with quote

Thank you James.

Not sure if this will help. but let me try it out.

I am using awstats to analyse the log file (and have specified the log file name as ols.access.log).

Not sure, how if specifying a new name everyday is feasible.

thanks again.
Jeevan
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Sun 25 Sep '11 14:09    Post subject: Reply with quote

Well I use awstats on some server,too. And I parse the logs 2 minutes before rotation.
Back to top
jnsunkersett



Joined: 30 Jan 2011
Posts: 23

PostPosted: Sun 25 Sep '11 15:37    Post subject: Reply with quote

great James,

Can you help me with AWSTATS specific questions?
or would you recommend another forum ?

thx
jeevan
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3094
Location: Hilversum, NL, EU

PostPosted: Sun 25 Sep '11 15:37    Post subject: Reply with quote

Just ask.

Steffen
Back to top
jnsunkersett



Joined: 30 Jan 2011
Posts: 23

PostPosted: Mon 26 Sep '11 9:31    Post subject: Reply with quote

Hello james,

I edited the httpd conf, to use %Y etc. (this was as of Sept 25, 5:17 PM )

Code:
CustomLog "|bin/rotatelogs.exe logs/ols.access.%Y-%m-%d.log 86400"  combined_with_forwarded_for


But I still got a log file containing logged data for both Sept25 and Sept 26.(what could I have done wrong ?)

Quote:
59.177.193.104 - - [25/Sep/2011:23:59:39 +0530] "POST https://10.0.1.9/bookDarshan.do?parameter=bookDarshan HTTP/1.0" 200 27587 "https://online.sai.org.in/bookDarshan.do?parameter=proceed" "Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
59.177.193.104 - - [25/Sep/2011:23:59:47 +0530] "POST https://10.0.1.9/bookDarshan.do?parameter=getAvailableDates HTTP/1.0" 200 28410 "https://online.sai.org.in/bookDarshan.do?parameter=bookDarshan" "Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
59.177.193.104 - - [25/Sep/2011:23:59:57 +0530] "POST https://10.0.1.9/bookDarshan.do?parameter=getServiceDetails HTTP/1.0" 200 28357 "https://online.sai.org.in/bookDarshan.do?parameter=getAvailableDates" "Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
---- this line inserted manually for easier reading ----
59.177.193.104 - - [26/Sep/2011:00:00:07 +0530] "POST https://10.0.1.9/bookDarshan.do?parameter=setServiceTypeDetails HTTP/1.0" 200 28637 "https://online.sai.org.in/bookDarshan.do?parameter=getServiceDetails" "Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
117.224.203.196 - - [26/Sep/2011:00:00:19 +0530] "POST https://10.0.1.9/forgotPassword.do?parameter=validateEmailAndDOB HTTP/1.0" 200 17023 "https://online.sai.org.in/forgotPassword.do?parameter=validateEmailAndDOB" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)"
182.156.74.227, 80.239.243.185 - - [26/Sep/2011:00:00:26 +0530] "POST https://10.0.1.9/roomBooking.do?parameter=searchRoomType HTTP/1.0" 200 64887 "https://online.sai.org.in/roomBooking.do?parameter=roomBooking" "Opera/9.80 (Android; Opera Mini/6.1.25655/25.872; U; en) Presto/2.5.25 Version/10.54"
182.156.74.227, 80.239.243.185 - - [26/Sep/2011:00:00:28 +0530] "GET https://10.0.1.9/images/header_bg2.gif HTTP/1.0" 200 1207 "https://online.sai.org.in/roomBooking.do?parameter=searchRoomType" "Opera/9.80 (Android; Opera Mini/6.1.25655/25.872; U; en) Presto/2.5.25 Version/10.54"
117.224.203.196 - - [26/Sep/2011:00:00:33 +0530] "POST https://10.0.1.9/login.do?parameter=login HTTP/1.0" 200 14038 "https://online.sai.org.in/login.do?parameter=reset" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)"
59.177.193.104 - - [26/Sep/2011:00:00:36 +0530] "GET https://10.0.1.9/selectedServices.do?parameter=showSelectedServices HTTP/1.0" 200 14953 "https://online.sai.org.in/bookDarshan.do?parameter=setServiceTypeDetails" "Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Mon 26 Sep '11 20:49    Post subject: Reply with quote

I think you have to define the timezone offset

http://httpd.apache.org/docs/2.2/programs/rotatelogs.html
Back to top
jnsunkersett



Joined: 30 Jan 2011
Posts: 23

PostPosted: Thu 29 Sep '11 12:26    Post subject: Reply with quote

James,

Posted a query concerning AWSTATS here;
http://www.apachelounge.com/viewtopic.php?p=19284#19284

Please have a look.

thx.
Jeevan
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Fri 30 Sep '11 15:30    Post subject: Reply with quote

Did the offset work for you?
Back to top


Reply to topic   Topic: RotateLogs in apache httpd, logfile name should be satic View previous topic :: View next topic
Post new topic   Forum Index -> Apache