Introduction

The mod_access module writes request logs and session logs in the specified format.

Configuration

  • Module config file

    conf/mod_access/mod_access.conf

    1. [Log]
    2. # filename prefix for log
    3. LogPrefix = access
    4. # access log directory
    5. LogDir = ./
    6. # log rotate interval: M/H/D/MIDNIGHT/NEXTHOUR
    7. RotateWhen = NEXTHOUR
    8. # max number of rotated log files
    9. BackupCount = 2
    10. [Template]
    11. # template of request log
    12. RequestTemplate = "REQUEST_LOG $time clientip: $remote_addr serverip: $server_addr host: $host product: $product user_agent: ${User-Agent}req_header status: $status_code error: $error"
    13. # template of session log
    14. SessionTemplate = "SESSION_LOG $time clientip: $ses_clientip start_time: $ses_start_time end_time: $ses_end_time overhead: $ses_overhead read_total: $ses_read_total write_total: $ses_write_total keepalive_num: $ses_keepalive_num error: $ses_error"