3.12 Library http/http_log -- HTTP Logging module

Simple module for logging HTTP requests to a file. Logging is enabled by loading this file and ensure the setting http:logfile is not the empty atom. The default file for writing the log is httpd.log. See library(settings) for details.

The level of logging can modified using the multifile predicate http_log:nolog/1 to hide HTTP request fields from the logfile and http_log:password_field/1 to hide passwords from HTTP search specifications (e.g. /topsecret?password=secret).

[semidet]http_log_stream(-Stream)
Returns handle to open logfile. Fails if no logfile is open and none is defined.
[det]http_log_close(+Reason)
If there is a currently open HTTP logfile, close it after adding a term server(Reason, Time). to the logfile. This call is intended for cooperation with the Unix logrotate facility using the following schema:

  • Move logfile (the HTTP server keeps writing to the moved file)
  • Inform the server using an HTTP request that calls http_log_close/1
  • Compress the moved logfile
author
Suggested by Jacco van Ossenbruggen
[det]http_log(+Format, +Args)
Write message from Format and Args to log-stream. See format/2 for details. Succeed without side effects if logging is not enabled.