Log Settings
Learning Focus
By the end of this lesson you will know how to configure access and error log paths, verbosity levels, and rotation to keep operational visibility without filling the disk.
Log Types
| Log | Default Path | Purpose |
|---|---|---|
| Server Error Log | /usr/local/lsws/logs/error.log | Server errors, config issues, runtime warnings |
| Access Log | /usr/local/lsws/logs/access.log | Every HTTP request with status, size, timing |
| stderr Log | /usr/local/lsws/logs/stderr.log | PHP fatal errors, external app output |
Error Log Levels
| Level | When to Use |
|---|---|
| ERROR | Production default — only errors |
| WARNING | Investigating intermittent issues |
| NOTICE | General operational monitoring |
| INFO | Detailed operational output |
| DEBUG | Active troubleshooting only — very verbose |
warning
High debug levels on busy servers generate massive log output and increase disk I/O. Only enable DEBUG temporarily during active troubleshooting.
Configuring in WebAdmin
- Navigate to Server Configuration → Log
- Set Log Level to
ERRORfor production - Configure Access Log path and format
- Set Rolling Size for automatic log rotation
- Save and Graceful Restart
Log Rotation
# Check current log sizes
du -sh /usr/local/lsws/logs/*
# OpenLiteSpeed can rotate automatically based on file size
# Configure "Rolling Size" in WebAdmin (e.g., 100MB)
# Or use system logrotate
cat > /etc/logrotate.d/openlitespeed << 'EOF'
/usr/local/lsws/logs/*.log {
daily
missingok
rotate 14
compress
notifempty
postrotate
/usr/local/lsws/bin/lswsctrl restart
endscript
}
EOF
Key Takeaways
- Use ERROR level in production, temporary DEBUG for troubleshooting.
- Configure log rotation to prevent disk exhaustion on busy servers.
- The error log is your primary diagnostic tool — learn to read it quickly.
What's Next
- Return to the Server Configuration module for the complete overview.