Skip to main content

Error Log Troubleshooting

Learning Focus

By the end of this lesson you will know how to read error log entries, recognize common patterns, and use logs to diagnose issues.

Log Location and Basic Commands

# View the most recent entries
tail -50 /usr/local/lsws/logs/error.log

# Follow the log in real time
tail -f /usr/local/lsws/logs/error.log

# Search for specific error patterns
grep -i "error\|failed\|denied" /usr/local/lsws/logs/error.log | tail -20

Common Error Patterns

Log PatternMeaningLikely Cause
Failed to start external appPHP cannot startWrong command path or permissions
Connection refusedSocket/port issuePHP not running or wrong socket
Permission deniedFile access blockedWrong ownership or permissions
SSL_CTX_use_certificate_chain_file failedCertificate errorWrong cert path or format
Max connections reachedWorker pool exhaustedIncrease max connections or optimize

Reading a Log Entry

A typical error line includes:

[ERROR] [192.168.1.1] [APVH_example] Failed to connect to socket ...
PartMeaning
[ERROR]Severity level
[192.168.1.1]Client IP (if applicable)
[APVH_example]Virtual host or component name
Rest of lineSpecific error description

Key Takeaways

  • The error log is your primary diagnostic tool — learn to read it quickly.
  • Use tail -f for real-time monitoring during troubleshooting.
  • Common patterns often point directly to the fix.

What's Next