|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Can apache log into a mySQL table?
Can apache log into a mySQL table on the local server?
Thank you very much, Bizzk |
|
#2
|
|||
|
|||
|
You can pipe that to a script and have your script insert the data into MySQL. In the real world, nobody is fool enough to do this to replace your existing logging mechanism. What you probably should do is to post process your logs via a cronjob.
|
|
#3
|
||||
|
||||
|
Is this done before? Are there any scripts I can use or do I have to code it myself? When you say "post process" do you mean an update every 15 minutes or something?
|
|
#4
|
|||
|
|||
|
>> When you say "post process" do you mean an update every 15 minutes or something?
Not exactly. I mean, do not change the Apache logging mechanism using a pipe | and pipe to a script. Why? Not reliable and slow and insecure. Post process it is to insert your rotated logs to a database, not as a logging replacement with your script. The rotated logs are the one sApache not currently write to, thus can be removed or inserted to a database or whatever. |
|
#5
|
||||
|
||||
|
You mean I should rotate my logs, and then use a script to insert the rotated logs into mySQL?
In the apache manual I found the following utitlity: rotatelogs. They say that that utility also uses the pipe feature. Do you recommend using this utility to rotate my logs? Once the logs are being rotated how can I insert them into mySQL? I have never done anything like that before. I suppose I have to get some kind of script or program and that changes the format to an *.sql file and run a cronjob to insert it every hour? Thanks, Bizzk |
|
#6
|
|||
|
|||
|
>> Do you recommend using this utility to rotate my logs?
rotatelog has an advantage for rotating your Apache log without restarting your server. What I've been saying was to suggest you not to log to a database in realtime. If you must insert your log to mysql, post process it to a mysql-acceptable-format with your script, then run a cronjob to actually inserting the data to mysql. |
|
#7
|
||||
|
||||
|
I think I understand what you mean, thanks. I think I will use some log analysing tool for the log stats, instead of writing my own mySQL/php tool. Those log utilties are actually quite smart!
Last edited by bizzk : July 23rd, 2001 at 01:15 AM. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Can apache log into a mySQL table? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|