Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache httpd request/response logging

Tags:

linux

apache

Is there a way to log request (full GET URI, response and POST data and response) content with Apache? I have a bunch of games that communicate with the client side over HTTP, they use different variables and output all sorts of things.

I'd like to push all this content into a database for further processing so I can report game play step by step. Cannot modify the server side game files themselves to log this data, they're too many (thousands).

It's not much data, up to 512 bytes or 1K per of both request and response data.

Can't set up a varnish or squid to do it, I have lots of back-end servers, can't add yet another layer to this, I have a load of stuff happening before the app servers (load balancing, firewall, whatnot).

TIA

like image 949
Nick M Avatar asked Dec 04 '13 21:12

Nick M


People also ask

Where does Apache write its incoming request logs?

In Linux, Apache commonly writes logs to the /var/log/apache2 or /var/log/httpd directories depending on your OS and Virtual Host overrides. You can also define a LogFormat string after the filename, which will only apply the format string to this file.

How do I enable Apache logging?

Open your /etc/apache2/apache2. conf file and place the line above below the other LogFormat lines. It will produce access log entries with the following details: %t : date and time of the request.

Does Apache Use syslog?

The default is to use syslog facility local7 , but you can override this by using the syslog: facility syntax where facility can be one of the names usually documented in syslog(1).


1 Answers

mod_dumpio will get it into a file.

http://httpd.apache.org/docs/2.2/mod/mod_dumpio.html

like image 116
Russ Huguley Avatar answered Sep 28 '22 00:09

Russ Huguley