You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Mark A. Craig" <ma...@gmail.com> on 2007/09/14 01:19:22 UTC

[users@httpd] Apache 2.2, rotatelogs.exe, and Windows

I want to use rotatelogs.exe to archive my logs with Apache 2.2 running 
in Windows 2000.  WHen I try to configure it the server fails to start 
and bitches about Unicode characters on line 1 of httpd.conf that aren't 
actually there.  I've read the docs repeatedly, but it's not entirely 
explicit about how to implement it, esp. under Windows.

    LogFormat "%a/%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" 
\"%{User-Agent}i\"" ip-host-combined

    # don't log (RSS) requests from FeedBurner
    SetEnvIfNoCase Remote_Host "fetch.feedburner.com" dontlog
    # don't log MSN search bots
    SetEnvIfNoCase Remote_Host ".+\.search.live.com" dontlog
    # don't log Yahoo! search bots
    SetEnvIfNoCase Remote_Host ".+\.crawl.yahoo.net" dontlog
    # don't log Google search bots
    SetEnvIfNoCase Remote_Host ".+\.googlebot.com" dontlog
    SetEnvIfNoCase Request_URI "^/robots\.txt$" dontlog
    SetEnvIfNoCase Request_URI "^/favicon\.ico$" dontlog

    CustomLog logs/access_ip-host-combined.log ip-host-combined env=!dontlog
    #CustomLog "|bin/rotatelogs 
logs/access_ip-host-combined.%Y-%m-%d-%H-%M-%S.log 2592000 -480" 
ip-host-combined env=!dontlog

Do I add a customlog pipe to rotatelogs IN ADDITION to existing log 
directives, or are they meant to replace the existing?  This is one of 
the things the docs fail to specify.  Another issue: what if I want an 
archived file of the form access_yyyy_mm-dd.LOG, as opposed to the 
example in the docs which shows the date-stamp BEING the extension?  
Does the parsing of rotatelogs allow such a variant?

Has anyone experimented with rotatelogs enough to know the answers to 
these questions?

Mark

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows

Posted by "Mark A. Craig" <ma...@gmail.com>.
Philip, do you use a scheduled CMD file to gracefully kill the server, rotate 
the logs, and then restart the server?  Given that rumor has it that piping is 
broken in 2.2.4, it seems something like that is the only way to do it right 
now, eh?  If what you're using contains no trade secrets, I'd be very curious to 
see exactly what you're using, so I can use it as boilerplate for my own 
solution.  I wonder if it could also be accomplished via a WSH file instead, and 
whether that would provide extra flexibility or benefits?

Mark

-------- Original Message  --------
Subject: Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows
From: Phillip Hamilton <ph...@myarchive.biz>
To: users@httpd.apache.org
Date: Tuesday, September 18, 2007 11:50:08 AM

> I wholeheartedly disagree with this statement:
> Apache holds only a tiny share of 
> Windows servers.
> 
> Apache holds a very large share of Windows server market, hence the
> pre-made binary. 
> 
> Back on topic, I rotate via a bat file with a quick re-start on my windows
> boxes ;)
> 
> -----Original Message-----
> From: Dragon [mailto:dragon@crimson-dragon.com] 
> Sent: Tuesday, September 18, 2007 1:02 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows
> 
> Mark A. Craig wrote:
>> So this leads me to ask again, what are all of you successful 2.2.4 
>> admins using to rotate your logs?  If the piping mechanism is 
>> broken, at least in the Windows binary, then what other technique(s) 
>> are people using?  Task Scheduler with a batch or CMD file?
>>
>> So far I've been manually rotating the logs, but I'd understandably 
>> like to automate it.
> ---------------- End original message. ---------------------
> 
> I think you will find that the vast majority of people using Apache 
> are not doing so on the Windows platform. Most people who have 
> committed to the Windows platform have also committed to IIS. Apache 
> dominates the Linux environment and is used frequently on BSD and 
> similar Unix-based platforms. Apache holds only a tiny share of 
> Windows servers.
> 
> I believe that those few who are using Apache on Windows tend to be 
> hobbyists or developers using it to serve their own stuff or to do 
> development off-line. I am willing to bet there are very few people 
> using it in a production environment under Windows.
> 
> So it is entirely possible that there may be nobody on this list who 
> has an answer for you. The set of people using it in the same manner 
> you are is small to begin with and there may not be many of them 
> subscribed to this list.
> 
> Repeatedly posting demanding
> 
> Dragon
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows

Posted by Phillip Hamilton <ph...@myarchive.biz>.
I wholeheartedly disagree with this statement:
Apache holds only a tiny share of 
Windows servers.

Apache holds a very large share of Windows server market, hence the
pre-made binary. 

Back on topic, I rotate via a bat file with a quick re-start on my windows
boxes ;)

-----Original Message-----
From: Dragon [mailto:dragon@crimson-dragon.com] 
Sent: Tuesday, September 18, 2007 1:02 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows

Mark A. Craig wrote:
>So this leads me to ask again, what are all of you successful 2.2.4 
>admins using to rotate your logs?  If the piping mechanism is 
>broken, at least in the Windows binary, then what other technique(s) 
>are people using?  Task Scheduler with a batch or CMD file?
>
>So far I've been manually rotating the logs, but I'd understandably 
>like to automate it.
---------------- End original message. ---------------------

I think you will find that the vast majority of people using Apache 
are not doing so on the Windows platform. Most people who have 
committed to the Windows platform have also committed to IIS. Apache 
dominates the Linux environment and is used frequently on BSD and 
similar Unix-based platforms. Apache holds only a tiny share of 
Windows servers.

I believe that those few who are using Apache on Windows tend to be 
hobbyists or developers using it to serve their own stuff or to do 
development off-line. I am willing to bet there are very few people 
using it in a production environment under Windows.

So it is entirely possible that there may be nobody on this list who 
has an answer for you. The set of people using it in the same manner 
you are is small to begin with and there may not be many of them 
subscribed to this list.

Repeatedly posting demanding

Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows

Posted by Dragon <dr...@crimson-dragon.com>.
Mark A. Craig wrote:
>So this leads me to ask again, what are all of you successful 2.2.4 
>admins using to rotate your logs?  If the piping mechanism is 
>broken, at least in the Windows binary, then what other technique(s) 
>are people using?  Task Scheduler with a batch or CMD file?
>
>So far I've been manually rotating the logs, but I'd understandably 
>like to automate it.
---------------- End original message. ---------------------

I think you will find that the vast majority of people using Apache 
are not doing so on the Windows platform. Most people who have 
committed to the Windows platform have also committed to IIS. Apache 
dominates the Linux environment and is used frequently on BSD and 
similar Unix-based platforms. Apache holds only a tiny share of 
Windows servers.

I believe that those few who are using Apache on Windows tend to be 
hobbyists or developers using it to serve their own stuff or to do 
development off-line. I am willing to bet there are very few people 
using it in a production environment under Windows.

So it is entirely possible that there may be nobody on this list who 
has an answer for you. The set of people using it in the same manner 
you are is small to begin with and there may not be many of them 
subscribed to this list.

Repeatedly posting demanding

Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows

Posted by "Mark A. Craig" <ma...@gmail.com>.
So this leads me to ask again, what are all of you successful 2.2.4 admins using 
to rotate your logs?  If the piping mechanism is broken, at least in the Windows 
binary, then what other technique(s) are people using?  Task Scheduler with a 
batch or CMD file?

So far I've been manually rotating the logs, but I'd understandably like to 
automate it.

Mark

-------- Original Message  --------
Subject: Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows
From: William A. Rowe, Jr. <wr...@rowe-clan.net>
To: users@httpd.apache.org
Date: Tuesday, September 18, 2007 08:37:29 AM

> Norman Peelman wrote:
>>  I am unsure of what would be causing your Unicode issues, sorry. That
>> being said.. i've heard/read that there are issues with rotatelogs on
>> W32 platforms. I have successfully used rotatelogs on my old XP box
>> after alot of hassle. What I found for me was that I had to use the full
>> path like so:
>>
>> ErrorLog "|G:/mydir/apache2/bin/rotatelogs.exe
>> G:/mydir/apache2/logs/my-error_log(%m-%d-%Y_%H-%M-%S).log 86400"
> 
> That would have worked for 2.0, not under 2.2.  Actually 2.2.6 gets this
> right but was flawed in a different way, 2.2.7 will have all the ducks
> in a row at last.
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Norman Peelman wrote:
> 
>  I am unsure of what would be causing your Unicode issues, sorry. That
> being said.. i've heard/read that there are issues with rotatelogs on
> W32 platforms. I have successfully used rotatelogs on my old XP box
> after alot of hassle. What I found for me was that I had to use the full
> path like so:
> 
> ErrorLog "|G:/mydir/apache2/bin/rotatelogs.exe
> G:/mydir/apache2/logs/my-error_log(%m-%d-%Y_%H-%M-%S).log 86400"

That would have worked for 2.0, not under 2.2.  Actually 2.2.6 gets this
right but was flawed in a different way, 2.2.7 will have all the ducks
in a row at last.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows

Posted by Norman Peelman <np...@cfl.rr.com>.
Mark A. Craig wrote:
> Nope, I excluded that as a possible cause pretty quickly.  I don't 
> know why, but it's something about the actual inclusion of the piped 
> commands to rotatelogs that actually causes the false error about 
> nonexistent Unicode characters.  If I uncomment them, I get the 
> error... if I comment them out, I don't.
>
> Now you know why I'm asking for help with this.  What exactly about my 
> syntax (see previous post with sample) is so broken that it could 
> cause such a non sequitur error?
>
> Mark
>
> -------- Original Message  --------
> Subject: Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows
> From: Vincent Bray <no...@gmail.com>
> To: users@httpd.apache.org
> Date: Saturday, September 15, 2007 08:47:21 AM
>
>> On 14/09/2007, Mark A. Craig <ma...@gmail.com> wrote:
>>> I want to use rotatelogs.exe to archive my logs with Apache 2.2 running
>>> in Windows 2000.  WHen I try to configure it the server fails to start
>>> and bitches about Unicode characters on line 1 of httpd.conf that 
>>> aren't
>>> actually there.  I've read the docs repeatedly, but it's not entirely
>>> explicit about how to implement it, esp. under Windows.
>>
>> Sounds like a BOM issue. Try either saving the config file with a
>> non-unicode encoding, or otherwise disable BOMs in your editor. Apache
>> is not able to deal with byte order marks in config files as far as i
>> know.
>>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Mark,

  I am unsure of what would be causing your Unicode issues, sorry. That 
being said.. i've heard/read that there are issues with rotatelogs on 
W32 platforms. I have successfully used rotatelogs on my old XP box 
after alot of hassle. What I found for me was that I had to use the full 
path like so:

ErrorLog "|G:/mydir/apache2/bin/rotatelogs.exe 
G:/mydir/apache2/logs/my-error_log(%m-%d-%Y_%H-%M-%S).log 86400"

Which in this example rotated the logs once a week. Also shown is the 
format you were looking for, i believe. This was used in a virtualhost. 
The only problem I noticed was that you may find many rotatelogs 
processes running. With three or four vh (rotated error and custom logs 
for each) I had about 20 rotatelogs processes in the task manager.


Norm

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows

Posted by "Mark A. Craig" <ma...@gmail.com>.
Nope, I excluded that as a possible cause pretty quickly.  I don't know why, but 
it's something about the actual inclusion of the piped commands to rotatelogs 
that actually causes the false error about nonexistent Unicode characters.  If I 
uncomment them, I get the error... if I comment them out, I don't.

Now you know why I'm asking for help with this.  What exactly about my syntax 
(see previous post with sample) is so broken that it could cause such a non 
sequitur error?

Mark

-------- Original Message  --------
Subject: Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows
From: Vincent Bray <no...@gmail.com>
To: users@httpd.apache.org
Date: Saturday, September 15, 2007 08:47:21 AM

> On 14/09/2007, Mark A. Craig <ma...@gmail.com> wrote:
>> I want to use rotatelogs.exe to archive my logs with Apache 2.2 running
>> in Windows 2000.  WHen I try to configure it the server fails to start
>> and bitches about Unicode characters on line 1 of httpd.conf that aren't
>> actually there.  I've read the docs repeatedly, but it's not entirely
>> explicit about how to implement it, esp. under Windows.
> 
> Sounds like a BOM issue. Try either saving the config file with a
> non-unicode encoding, or otherwise disable BOMs in your editor. Apache
> is not able to deal with byte order marks in config files as far as i
> know.
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2, rotatelogs.exe, and Windows

Posted by Vincent Bray <no...@gmail.com>.
On 14/09/2007, Mark A. Craig <ma...@gmail.com> wrote:
> I want to use rotatelogs.exe to archive my logs with Apache 2.2 running
> in Windows 2000.  WHen I try to configure it the server fails to start
> and bitches about Unicode characters on line 1 of httpd.conf that aren't
> actually there.  I've read the docs repeatedly, but it's not entirely
> explicit about how to implement it, esp. under Windows.

Sounds like a BOM issue. Try either saving the config file with a
non-unicode encoding, or otherwise disable BOMs in your editor. Apache
is not able to deal with byte order marks in config files as far as i
know.

-- 
noodl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.2, rotatelogs.exe, and Windows

Posted by Norman Peelman <np...@cfl.rr.com>.
Sander Temme wrote:
>
> On Sep 15, 2007, at 8:30 AM, Mark A. Craig wrote:
>
>> Nothing?  No one has ever used rotatelogs.exe?  Well, surely all you 
>> pros out there are rotating your companies' logs somehow... what and 
>> how are you doing it, and is it something I can use?
>
> Rotatelogs should once again be usable as of 2.2.7.  Before, the 
> brokenness lay in the fact that it would leak stale rotatelogs.exe 
> processes and cmd.exe shells upon server stop, start, restart or child 
> process recycling (like crashes).  Your config file problem is likely 
> just that: a config file problem.  Your config files should be ASCII, 
> and there should be no need to edit them with anything more 
> sophisticated than Notepad.
>
> I have the following invocation of rotatelogs commented out in one of 
> my configurations:
>
> CustomLog "|d:/httpd-2.2.3-ssl/bin/rotatelogs.exe 
> d:/cedserver/logs/access-%Y-%m-%d.log 86400 -420" common
>
> Note 1) forward slashes 2) no spaces in the paths (perhaps you can do 
> that with careful quoting but I didn't have the patience" 3) 24 * 60 * 
> 60 == 86400 seconds in a day (not a week like another respondent seems 
> to think) and -420 is 7 timezones west of GMT, your mileage may vary.
>

Yes, that was a typo on my part... was waiting for someone to notice. :)

Norm

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache 2.2, rotatelogs.exe, and Windows

Posted by Sander Temme <sc...@apache.org>.
On Sep 15, 2007, at 8:30 AM, Mark A. Craig wrote:

> Nothing?  No one has ever used rotatelogs.exe?  Well, surely all  
> you pros out there are rotating your companies' logs somehow...  
> what and how are you doing it, and is it something I can use?

Rotatelogs should once again be usable as of 2.2.7.  Before, the  
brokenness lay in the fact that it would leak stale rotatelogs.exe  
processes and cmd.exe shells upon server stop, start, restart or  
child process recycling (like crashes).  Your config file problem is  
likely just that: a config file problem.  Your config files should be  
ASCII, and there should be no need to edit them with anything more  
sophisticated than Notepad.

I have the following invocation of rotatelogs commented out in one of  
my configurations:

CustomLog "|d:/httpd-2.2.3-ssl/bin/rotatelogs.exe d:/cedserver/logs/ 
access-%Y-%m-%d.log 86400 -420" common

Note 1) forward slashes 2) no spaces in the paths (perhaps you can do  
that with careful quoting but I didn't have the patience" 3) 24 * 60  
* 60 == 86400 seconds in a day (not a week like another respondent  
seems to think) and -420 is 7 timezones west of GMT, your mileage may  
vary.

The above is commented out though because I haven't upgraded to 2.2.7  
yet.  At this point I have a Perl script that I need to hang in the  
Windows Scripting Host, that does the following:

1) Move the old log out of the way
2) Give httpd a soft restart by calling:

    my $command = "\"$httpd\" -d \"$ServerRoot\" -n $servicename -k  
restart";
    my $out = `$command`;

3) Zip up the old logfiles

Of course I have set $httpd, $ServerRoot and $servicename  
beforehand.  The script also performs log analysis, but that's  
outside the scope of this discussion.

This approach has the following advantages over other procedures  
suggested in this thread:

1) No service interruption: net stop Apache2.2 causes the server to
    become unavailable (obviously) becasuse the process is shut down.
    This also happens ungracefully, so anyone currently accessing your
    server is confronted with errors
2) No lost log entries: by moving the log files out of the way, Apache
    will keep writing to the open filehandles.  Only when it is  
restarted
    will it open its new log files, without interruption in logging.
    Zipping up the logfiles and overwriting them with empty files leaves
    a hiatus in which you may lose log entries.

Determining the name of the old logfiles, and the archived files, is  
left as an exercise for the reader.  Of course you can do this in any  
scripting language as long as you can call a command line program.

S.

-- 
Sander Temme
sctemme@apache.org
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF




[users@httpd] Re: Apache 2.2, rotatelogs.exe, and Windows

Posted by "Mark A. Craig" <ma...@gmail.com>.
Nothing?  No one has ever used rotatelogs.exe?  Well, surely all you pros out 
there are rotating your companies' logs somehow... what and how are you doing 
it, and is it something I can use?

Mark

-------- Original Message  --------
Subject: Apache 2.2, rotatelogs.exe, and Windows
From: Mark A. Craig <ma...@gmail.com>
To: users@httpd.apache.org
Date: Thursday, September 13, 2007 04:19:22 PM

> I want to use rotatelogs.exe to archive my logs with Apache 2.2 running 
> in Windows 2000.  WHen I try to configure it the server fails to start 
> and bitches about Unicode characters on line 1 of httpd.conf that aren't 
> actually there.  I've read the docs repeatedly, but it's not entirely 
> explicit about how to implement it, esp. under Windows.
> 
>    LogFormat "%a/%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" 
> \"%{User-Agent}i\"" ip-host-combined
> 
>    # don't log (RSS) requests from FeedBurner
>    SetEnvIfNoCase Remote_Host "fetch.feedburner.com" dontlog
>    # don't log MSN search bots
>    SetEnvIfNoCase Remote_Host ".+\.search.live.com" dontlog
>    # don't log Yahoo! search bots
>    SetEnvIfNoCase Remote_Host ".+\.crawl.yahoo.net" dontlog
>    # don't log Google search bots
>    SetEnvIfNoCase Remote_Host ".+\.googlebot.com" dontlog
>    SetEnvIfNoCase Request_URI "^/robots\.txt$" dontlog
>    SetEnvIfNoCase Request_URI "^/favicon\.ico$" dontlog
> 
>    CustomLog logs/access_ip-host-combined.log ip-host-combined env=!dontlog
>    #CustomLog "|bin/rotatelogs 
> logs/access_ip-host-combined.%Y-%m-%d-%H-%M-%S.log 2592000 -480" 
> ip-host-combined env=!dontlog
> 
> Do I add a customlog pipe to rotatelogs IN ADDITION to existing log 
> directives, or are they meant to replace the existing?  This is one of 
> the things the docs fail to specify.  Another issue: what if I want an 
> archived file of the form access_yyyy_mm-dd.LOG, as opposed to the 
> example in the docs which shows the date-stamp BEING the extension?  
> Does the parsing of rotatelogs allow such a variant?
> 
> Has anyone experimented with rotatelogs enough to know the answers to 
> these questions?
> 
> Mark
> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org