http_set_log_file, http_get_log_file - enable HTTP logs on file pointer |
#include <pthr_http.h> FILE *http_set_log_file (FILE *fp); FILE *http_get_log_file (void); |
The FILE *fp argument to http_set_log_file sets the file pointer on which HTTP logs are generated. To disable logging, set fp to NULL. The function returns fp. |
http_get_log_file returns the current file pointer or NULL if logging is disabled. |
The default is that logging is disabled. |
Currently log messages are generated at the end of the HTTP response headers and have the following fixed format: |
YYYY/MM/DD HH:MM ip:port - "METHOD URL HTTP/x.y" CODE length "Referer" "User Agent" |
The first "-" is intended to store the HTTP auth username, when HTTP authorization is supported by the library. The "length" field is only known if the caller sends back a "Content-Length" header. Otherwise 0 is printed in that position. |
Log format should be customizable. It should be possible (optionally, of course) to look up the IP address and print a hostname. |
Richard Jones <rich@annexia.org> |
GNU LGPL (see http://www.gnu.org/) |
pthrlib-3.0.3 |
new_http_request(3), new_cgi(3), new_pseudothread(3), io_fdopen(3), RFC 2616. |