Schema definition for the Access Log Plugin, which provides HTTP request logging in various formats (Apache Common, Combined, JSON).
Property | Value |
---|---|
Schema URL | https://rustybeam.net/schema/AccessLogPlugin |
Parent Schema | https://rustybeam.net/schema/UtilityPlugin |
Description | HTTP request access logging with multiple format options |
Property | Type | Cardinality | Description |
---|---|---|---|
logfile | https://rustybeam.net/schema/URL | 0..1 | Path to access log file. Supports file:// URLs. If not specified, logs to stdout. Plugin creates parent directories automatically. |
log_file | https://rustybeam.net/schema/URL | 0..1 | Alternative name for logfile property (backward compatibility). Use logfile instead. |
format | https://rustybeam.net/schema/Text | 0..1 | Log format style: "common" (Apache Common Log), "combined" (Apache Combined Log), or "json". Defaults to "common". |
name | https://rustybeam.net/schema/Text | 0..1 | Plugin instance name for identification. Defaults to "access-log" if not specified. |
<tr itemscope itemtype="https://rustybeam.net/schema/AccessLogPlugin">
<span itemprop="library">file://./plugins/librusty_beam_access_log.so</span>
<span itemprop="logfile">file://./logs/access.log</span>
</tr>
<tr itemscope itemtype="https://rustybeam.net/schema/AccessLogPlugin">
<span itemprop="library">file://./plugins/librusty_beam_access_log.so</span>
<span itemprop="logfile">file://./logs/access.json</span>
<span itemprop="format">json</span>
<span itemprop="name">json_logger</span>
</tr>
<tr itemscope itemtype="https://rustybeam.net/schema/AccessLogPlugin">
<span itemprop="library">file://./plugins/librusty_beam_access_log.so</span>
<span itemprop="logfile">file://./logs/combined.log</span>
<span itemprop="format">combined</span>
</tr>
<tr itemscope itemtype="https://rustybeam.net/schema/AccessLogPlugin">
<span itemprop="library">file://./plugins/librusty_beam_access_log.so</span>
<span itemprop="format">common</span>
</tr>
Standard Apache Common Log Format with basic request information:
127.0.0.1 - - [10/Jul/2025:14:30:45 +0000] "GET /index.html HTTP/1.1" 200 1234
Fields: IP, identity, authuser, timestamp, request, status, bytes
Extended Apache format with referrer and user agent:
127.0.0.1 - - [10/Jul/2025:14:30:45 +0000] "GET /index.html HTTP/1.1" 200 1234 "https://example.com" "Mozilla/5.0..."
Fields: Common format + referrer + user agent
Structured JSON format for machine parsing and log analysis:
{
"timestamp": "2025-07-10T14:30:45Z",
"remote_ip": "127.0.0.1",
"method": "GET",
"path": "/index.html",
"protocol": "HTTP/1.1",
"status": 200,
"bytes": 1234,
"referrer": "https://example.com",
"user_agent": "Mozilla/5.0...",
"duration_ms": 15
}
X-Forwarded-For
(proxy/load balancer)X-Real-IP
(reverse proxy)This schema inherits from the UtilityPlugin schema, which provides:
logfile
- Log file path (used by AccessLogPlugin)directory
- Directory configurationenabled
- Plugin enable/disable stateAnd ultimately from the base Plugin schema, which provides:
library
- Plugin library pathplugin
- Base plugin reference propertylogfile
property should be a valid file path or file:// URLformat
property must be one of: "common", "combined", "json"name
property should be unique if multiple access log plugins are usedlogfile
or log_file
, not both (prefer logfile
)# Most common IPs
grep -o '^[^ ]*' access.log | sort | uniq -c | sort -nr | head -10
# Most requested paths
awk '{print $7}' access.log | sort | uniq -c | sort -nr | head -10
# Error requests (4xx/5xx status codes)
awk '$9 ~ /^[45]/ {print}' access.log
# Requests by hour
awk '{print $4}' access.log | cut -d: -f2 | sort | uniq -c