Apache webserver can be configured to save access logs into database via Apache Module mod_log_config.

This module provides for flexible logging of client requests. Logs are written in a customizable format, and may be written directly to a file, or to an external program. Conditional logging is provided so that individual requests may be included or excluded from the logs based on characteristics of the request.

“LogFormat” directive specifies the format of the access log file.

Syntax:

Example:

This example save into database: IP, date, http status, sent bytes, content type, requested url, user agent, referer;

Mysql table:

 

Save Apache log in MySQL database
Tagged on:                         

One thought on “Save Apache log in MySQL database

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.