accesslog.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. =========
  2. Accesslog
  3. =========
  4. ---------------------
  5. Module: mod_accesslog
  6. ---------------------
  7. :Author: Jan Kneschke
  8. :Date: $Date: 2004/11/03 22:26:05 $
  9. :Revision: $Revision: 1.2 $
  10. :abstract:
  11. The accesslog module ...
  12. .. meta::
  13. :keywords: lighttpd, accesslog, CLF
  14. .. contents:: Table of Contents
  15. Description
  16. ===========
  17. CLF like by default, flexible like apache
  18. Options
  19. =======
  20. accesslog.use-syslog
  21. send the accesslog to syslog
  22. Default: disabled
  23. accesslog.filename
  24. name of the file where the accesslog should be written too if syslog
  25. is not used.
  26. if the name starts with a '|' the rest of the name is taken
  27. as the name of a process which will be spawn and will get the
  28. output
  29. e.g.: ::
  30. accesslog.filename = "/var/log/lighttpd.log"
  31. $HTTP["host"] == "mail.example.org" {
  32. accesslog.filename = "|/usr/bin/cronolog"
  33. }
  34. Default: disabled
  35. accesslog.format
  36. the format of the logfile
  37. ====== ================================
  38. Option Description
  39. ====== ================================
  40. %% a percent sign
  41. %h name or address of remote-host
  42. %l ident name (not supported)
  43. %u authenticated user
  44. %t timestamp for the request-start
  45. %r request-line
  46. %s status code
  47. %b bytes sent for the body
  48. %i HTTP-header field
  49. %a remote address
  50. %A local address
  51. %B same as %b
  52. %C cookie field (not supported)
  53. %D time used in ms (not supported)
  54. %e environment (not supported)
  55. %f physical filename
  56. %H request protocol (HTTP/1.0, ...)
  57. %m request method (GET, POST, ...)
  58. %n (not supported)
  59. %o `response header`_
  60. %p server port
  61. %P (not supported)
  62. %q query string
  63. %T time used in seconds
  64. %U request URL
  65. %v server-name
  66. %V (not supported)
  67. %X connection status
  68. %I bytes incoming
  69. %O bytes outgoing
  70. ====== ================================
  71. If %s is written %>s or %<s the < and the > are ignored. They are support
  72. for compat with apache.
  73. %i and %o expect the name of the field which should be written in curly brackets.
  74. e.g.: ::
  75. accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{User-Agent}i\" \"%{Referer}i\""
  76. Default: CLF compatible output
  77. Response Header
  78. ---------------
  79. The accesslog module provides a special way to log content from the
  80. application in a accesslog file. It can be used to log the session id into a
  81. logfile.
  82. If you want to log it into the accesslog just specify the field-name within
  83. a %{...}o like ::
  84. accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{User-Agent}i\" \"%{Referer}i\" \"%{X-LIGHTTPD-SID}o\""
  85. The prefix ``X-LIGHTTPD-`` is special as every response header starting with
  86. this prefix is assumed to be special for lighttpd and won't be sent out
  87. to the client.
  88. An example the use this functionality is provided below: ::
  89. <?php
  90. session_start();
  91. header("X-LIGHTTPD-SID: ".session_id());
  92. ?>