Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

log file rotation? 1

Status
Not open for further replies.

Hondy

Technical User
Mar 3, 2003
864
GB
Hi

(noob) My apache logs are growing quite large, I'm used to IIS logs that start afresh each day. Is there anyway to do this in Apache?

e.g.

080911_access_log
080911_error_log
080912_access_log
080912_error_log

Even better would be a new folder created with the date on and the logs just archive off to the folders

Any advice please?
 
Hi

Please note that there is a conceptual difference. Apache comes from a system where each software does its task. Apache serves documents through HTTP and HTTPS. Rotating the log files is not its job.

Read Log Rotation in the documentation and take a look at the rotatelogs utility.

Or consider letting a specialized software to do it. That would depend on what operating system are you using.

Feherke.
 
i understand what you are saying actually. The thing I don't understand why nothing comes as a package - why doesn't Apache have something in the conf to choose the style of logging. I have a Windows background, so don't flame me, i'm still trying to work out the subtleties, they are completely different as you know! :)
 
By 'style of logging' I assume you mean exactly what gets logged and in what format. For that, you can create your own custom log format, but as feherke mentioned, it's another utility's job to actually do the rotation. In a linux system, the logrotate utility is what is responsible to rotate the logs for all servers, not just apache.
 
the answere to why is simple

Unix philosophy, one program one job (& do it well)

use a combination of the right tools to achive the final result

windows philosophy - one programm to do everything. Jack of all trades master of none.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top