Reputation: 25
I'm searching for a way to log http errors on Apache so I can track how to server goes and whose getting errors and for what kind of reason...
I would like to have a log file on my ubuntu server which, per line, indicate
YYYY.MM.DD Client-IP RECIEVED-403-ERROR /ON-THIS-PAGE
YYYY.MM.DD Client-IP RECIEVED-500-ERROR /ON-THIS-PAGE
no nescecery in this order but I guess you got the idea.
By this I will have information on: 1. how often my visitors recieve 500 error 2. Are there any cyber-kids or real hackers that want to find open directories (403 Forbidden) 3.
Upvotes: 0
Views: 55
Reputation: 23900
You should have a look at Access Logging. The LogFormat directive you want should be:
LogFormat %{%Y.%m.%d}t %h %>s %r
Upvotes: 1
Reputation: 1270
In fact, apache already has lots of detailed logs in /var/log/apache folder. If you want to get detailed info as in the format you have mentioned above, then you will need to parse original logs and generate a report for example. Also, as these logs are text based and have a predefined structures, you can extract your required information.
Upvotes: 0