Skip to main content

Log Format

Learning Focus

By the end of this lesson you will understand the default access log format and how to customize it.

Default Log Format

OpenLiteSpeed uses a Combined Log Format by default, similar to Apache:

%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"
FieldDescriptionExample
%hClient IP address203.0.113.50
%tTimestamp[10/Mar/2026:14:30:00 +0000]
%rRequest lineGET /page HTTP/1.1
%>sStatus code200
%bResponse size (bytes)4523
RefererReferring URLhttps://google.com
User-AgentBrowser/client stringMozilla/5.0 ...

Reading Access Logs

# View recent entries
tail -20 /usr/local/lsws/logs/access.log

# Count requests by status code
awk '{print $9}' /usr/local/lsws/logs/access.log | sort | uniq -c | sort -rn

# Top 10 requested URLs
awk '{print $7}' /usr/local/lsws/logs/access.log | sort | uniq -c | sort -rn | head -10

# Top 10 client IPs
awk '{print $1}' /usr/local/lsws/logs/access.log | sort | uniq -c | sort -rn | head -10

Customizing in WebAdmin

  1. Server ConfigurationLogAccess Log
  2. Adjust Log Format field
  3. Save and Graceful Restart

Key Takeaways

  • The Combined Log Format gives you IP, timestamp, URL, status, and user agent per request.
  • Use awk and sort commands to quickly analyze log patterns.
  • Customize the format if you need additional fields.

What's Next