Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rotate log for apache behaves strange



Wolfram Stebel wrote:
[...]

As always, the devil is in the details!
Wouldn't it be possible to remove the -v, to have normale rotation via this
script?

Yes, but you would then encounter (at least) two problems:
- you are changing an Apple-supplied system file, which is always a delicate action
- you have to change the web server's settings, so that all log files are directly written to /var/log/httpd/access_log and /var/log/httpd/error_log

Will it work without restart of apache?

No, as soon as you change the web server's settings, you have in any case to restart it (which is quite innocuous with a "sudo apachectl restart" command, unless you have lots of virtuals hosts and/or connected users).
Instead, when you activate "archive every n day" in server admin, apache
continues to write log files, but with a random extension.
Yes, that's the behavior of the rotatelogs binary.
That makes me sigh...

...
How can i change the setup for this?

You would have to manually change the logging settings in apache's
configuration files; unless it is directly feasible through the GUI by
providing an appropriate log file name - not in front of a server here.
(see the man page of rotatelogs(8) for the naming of the log files).
Thanks for this pointer, as far as i see, there will always be an appendix
to the log file name...
Before drawing any conclusion, I would first do some trials to see if they are correct in their man page:

    If logfile includes  any %  characters, it is treated
    as a format string for strftime(3).
    Otherwise, the suffix .nnnn is automatically added
    and is the time at which the logfile was created.

According to this, it should be possible to avoid the .nnnn suffix.
For example, assuming a weekly rotation for rotatelogs, you could try to use the "%W" specification in the log file name, so as to have a reference to the week number (00-53) in that name; someting like:
    host1.access.%W
    host1.error.%W
I probably have to change something in my application logic.

Yes, if you were expecting the ".0.gz", ".1.gz"... naming scheme.
But then the week number scheme could be as easy.

HTH,
Axel
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden

References: 
 >Re: Rotate log for apache behaves strange (From: Wolfram Stebel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.