The Apache Haus Forum

Advanced search  

News:

Welcome to Apache Haus Distribution Forum

Pages: [1]   Go Down

Author Topic: mod_log_rotate  (Read 11917 times)

Mitron

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
mod_log_rotate
« on: January 15, 2011, 09:01:32 PM »

Hmm, I just downloaded mod_log_rotate-1.0-x86.zip and tried it on your Apache 2.2.17 release without success.  Is your mod_log_rotate release not compatible with your Apache 2.2.17 release?
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 849
Re: mod_log_rotate
« Reply #1 on: January 16, 2011, 01:04:03 AM »

It should be compatible but no it was built against an earlier release. There has been no change in the API of Apache nor one that would hurt modules in the APR that I can think. But I'll have a look at it and give it a try on my test machine and report what I find.
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 586
Re: mod_log_rotate
« Reply #2 on: January 16, 2011, 08:42:41 PM »

I gonna test that on my w2k8. There I run it successful, but x64. So it might take this night to test it.

By the way: what is the error message you got? Doesn't it load? Any other error?
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 586
Re: mod_log_rotate
« Reply #3 on: January 16, 2011, 09:36:20 PM »

I can confirm that issue. it loads without any error.

My test config /what I have changed in httpd.conf:
Code: [Select]
LoadModule log_rotate_module modules/mod_log_rotate.so

RotateInterval 5

CustomLog "logs/%Y-%m-%d-access.log" common

the %Y-%m-%d is not resolved. So in the file system there is a file named %Y-%m-%d-access.log and 2011-01-16-access.log
And log rotation does not work at all.

I also switched LogLevel to debug, but there is nothing in the logs.


--- edit ---

tested on my 32 bit XP SP3 updates until begin of December (M$ virtual PC)
Logged

Mitron

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
Re: mod_log_rotate
« Reply #4 on: January 17, 2011, 05:44:49 AM »

I gonna test that on my w2k8. There I run it successful, but x64. So it might take this night to test it.

By the way: what is the error message you got? Doesn't it load? Any other error?

Apache doesn't load at all with the module.  I get this in Event Viewer.

Faulting application httpd.exe, version 2.2.17.0, faulting module msvcr90.dll, version 9.0.21022.8, fault address 0x0005b84f.

BTW, I have ActiveState Perl 5.12.2 and Visual Studio 2008 Professional also on that machine if that makes a difference.
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 849
Re: mod_log_rotate
« Reply #5 on: January 17, 2011, 01:51:55 PM »

Mario,

Thanks for picking this up for me, I do not have a 2.2.17 to use for testing at the moment.
I do however have a snapshot build of 2.3.11-dev from a couple days ago and here is what I am seeing with it

With just this
Code: [Select]
LoadModule log_rotate_module modules/mod_log_rotate.so
RotateInterval 5
CustomLog "logs/%Y-%m-%d-access.log" combined

I ended up with a  %Y-%m-%d-access.log and 2011-01-17-access.log file as you saw and no rotation.

but with this,

Code: [Select]
LoadModule log_rotate_module modules/mod_log_rotate.so
RotateLogs On
RotateInterval 5
CustomLog "logs/%Y-%m-%d-access.log" combined

I started getting
http://www.apachehaus.net/logsrotating.gif

As you can see, I'm getting a load of .####### files plus the one 2011-01-17-access.log. After adding the "RotateLogs On" it never again gave me the %Y-%m-%d-access.log file which I deleted and did a couple graceful restarts, never got another. I figure I am getting the numbered ones cause iI ended up setting for 5 minutes (300s), e.g. less than one day. 

So on 2.3 at least it is working. You can see how I had just turned it on since that one access.log is 16 megs
So I assume with RotateInterval 86400 I'll get one a day.

Yep, another access & deflate log just dropped in the folder.

Oh and btw, with RotateInterval 5 I only got one every 2 minutes, so there might be a minimum of 120 seconds built in.

Well .. in the module source I see this but I'm seeing 120 seconds, not 60 as it states.
Code: [Select]
* RotateInterval       Set the interval in seconds for log rotation. The
 *                      default is 86400 (one day). The shortest interval that
 *                      can be specified is 60 seconds. An optional second

You can see that in the  time diff between the first to numbered logs, then I turned it up to 5 minutes.
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 586
Re: mod_log_rotate
« Reply #6 on: January 17, 2011, 06:00:47 PM »

I wonder since it works with the x64 version for me totaly clean and as expected. I'll try to compile it against 2.2.17 this night and see what happens.
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 586
Re: mod_log_rotate
« Reply #7 on: January 18, 2011, 02:05:31 PM »

I got it working.

I forgot the RotateLogs On. What a pitty!
I saw than when I enabled server-info for debugging. Well that was quiet helpful. Cause I can see there anything that is set different to default in httpd.conf and RotateLogs is set to off by default.

It works fine. I downloaded all stuff from AH and it works a expected.

And it was on a fresh XP install (VirtualBox). So I wonder why it is not working for you. To fully make sure that the 2.2.17 is clean I compiled mod_log_rotate new against it and it also works fine.

There must some kinda different issue. You might also enable server-info module and check if the module is loaded or not.
Logged

Mitron

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
Re: mod_log_rotate
« Reply #8 on: January 20, 2011, 07:57:23 AM »

Hmm, interesting.  Well your release of Apache runs on my setup until I try to load that module.  Wonder if Perl could be causing issues.  Maybe I'll revert back to 5.8.9 to see if that helps..  Thanks for checking into it anyhow..
Logged

TomD

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
Re: mod_log_rotate
« Reply #9 on: January 23, 2011, 05:11:26 PM »

Perhaps it is a runtime-library version problem.

I noticed that your event log says: msvcr90.dll, version 9.0.21022.8,
but the ApacheHaus server and modules are built with version 9.0.30729.4148.

You could try updating your Visual Studio 2008 to Microsoft Visual Studio 2008 Service Pack 1,
or else just installing the Microsoft Visual C++ 2008 SP1 Redistributable Package (x86).

-tom-
Logged

Mitron

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
Re: mod_log_rotate
« Reply #10 on: April 26, 2011, 06:27:37 PM »

Tom was right, I had to update my VS2008 to make it load.

I did notice that if you turn RotateLogs Off in httpd.conf, you can't turn it back on in httpd-vhost.conf.
Of course you still can't get the time to work either.

For instance this:
access.%Y%m%d%H%M%S.log

produces this:
access.20110426000000.log

no matter what time the log was created.


Logged
Pages: [1]   Go Up
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13