Skip to main content

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

LogDefault PathPurpose
Server Error Log/usr/local/lsws/logs/error.logServer errors, config issues, runtime warnings
Access Log/usr/local/lsws/logs/access.logEvery HTTP request with status, size, timing
stderr Log/usr/local/lsws/logs/stderr.logPHP fatal errors, external app output

Error Log Levels

LevelWhen to Use
ERRORProduction default — only errors
WARNINGInvestigating intermittent issues
NOTICEGeneral operational monitoring
INFODetailed operational output
DEBUGActive 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

  1. Navigate to Server ConfigurationLog
  2. Set Log Level to ERROR for production
  3. Configure Access Log path and format
  4. Set Rolling Size for automatic log rotation
  5. 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