# Fix Apache LogLevel Core Debug Configuration
You're trying to enable debug logging in Apache with LogLevel core:debug but it's not working as expected, or you need to configure proper logging levels for troubleshooting.
Apache's LogLevel directive controls the verbosity of error logging. Understanding the syntax and levels helps diagnose server issues.
Introduction
You are trying to enable debug logging in Apache with LogLevel core:debug but it is not working as expected, or you need to configure proper logging levels for troubleshooting. Apache's LogLevel directive controls the verbosity of error logging. Understanding the syntax and levels helps diagnose server issues.
LogLevel syntax and parameters: - module - Specific Apache module (core, ssl, proxy, etc.) - level - Logging verbosity (emerg, alert, crit, error, warn, notice, info, debug, trace1-8)
Symptoms
Apache LogLevel issues present with: - Debug logs not appearing despite configuration - LogLevel settings being overridden - Module-specific logging not working - Too verbose logging filling disk space - Missing error details in logs - Log files empty or not created
Common LogLevel levels for troubleshooting:
LogLevel [module:]level [module:level] ...- module - Specific Apache module (core, ssl, proxy, etc.)
- level - Logging verbosity (emerg, alert, crit, error, warn, notice, info, debug, trace1-8)
Common Causes
- Configuration misconfiguration
- Missing or incorrect credentials
- Network connectivity issues
- Version compatibility problems
- Resource exhaustion or limits
- Permission or access denied
Step-by-Step Fix
- 1.Check logs for specific error messages
- 2.Verify configuration settings
- 3.Test network connectivity
- 4.Review recent changes
- 5.Apply corrective action
- 6.Verify the fix
LogLevel Levels (Increasing Verbosity)
| Level | Description |
|---|---|
| emerg | System unusable |
| alert | Action must be taken |
| crit | Critical conditions |
| error | Error conditions |
| warn | Warning conditions |
| notice | Normal but significant |
| info | Informational messages |
| debug | Debug-level messages |
| trace1 | Trace level 1 |
| trace2-8 | Higher trace levels |
Common Issues and Solutions
Issue 1: LogLevel Not Applied
```apache # Configuration LogLevel core:debug
# But logs still show only errors ```
Cause: LogLevel may be overridden elsewhere.
Solution: Check all configuration files:
```bash # Find all LogLevel directives grep -r "LogLevel" /etc/apache2/ grep -r "LogLevel" /etc/httpd/
# Check virtual hosts apache2ctl -S | grep -i log
# Ensure LogLevel is in correct context # Can be set in: server config, virtual host, directory ```
Place LogLevel in the right context:
```apache # Server-wide LogLevel core:debug
# Or in specific virtual host <VirtualHost *:80> ServerName example.com LogLevel core:debug ErrorLog /var/log/apache2/example.com-error.log </VirtualHost> ```
Issue 2: Module-Specific Logging
```apache # Enable debug for specific modules LogLevel core:debug ssl:debug proxy:debug
# Or all modules at debug LogLevel debug ```
Common modules to debug:
```apache # SSL/TLS issues LogLevel ssl:debug
# Proxy issues LogLevel proxy:debug proxy_http:debug
# Rewrite issues LogLevel rewrite:trace3
# Authentication LogLevel auth:debug authz:debug ```
Issue 3: ErrorLog Not Configured
LogLevel requires ErrorLog to be set:
```apache # Global error log ErrorLog /var/log/apache2/error.log LogLevel core:debug
# Virtual host error log <VirtualHost *:80> ErrorLog /var/log/apache2/example-error.log LogLevel core:debug </VirtualHost> ```
Issue 4: Logs Not Writing
```bash # Check log directory permissions ls -la /var/log/apache2/
# Ensure Apache can write chown -R www-data:www-data /var/log/apache2/ chmod 755 /var/log/apache2/ chmod 644 /var/log/apache2/*.log ```
Issue 5: Too Much Logging
Debug level generates lots of logs:
```apache # Use module-specific logging instead LogLevel warn core:info ssl:debug
# Or conditional logging <IfDefine DEBUG> LogLevel debug </IfDefine> ```
Issue 6: Trace Levels Not Working
```apache # Trace levels require specific module LogLevel rewrite:trace8 # Works for mod_rewrite
# But not for core LogLevel core:trace8 # Invalid - core doesn't have trace ```
Use appropriate levels per module:
```apache # Core supports up to debug LogLevel core:debug
# Rewrite supports trace1-8 LogLevel rewrite:trace3
# SSL supports debug LogLevel ssl:debug ```
Issue 7: Per-Directory LogLevel
LogLevel can be set per-directory:
```apache <Directory /var/www/html/admin> LogLevel debug </Directory>
# But this only works for certain contexts # ErrorLog cannot be set per-directory ```
Issue 8: Logging Format Issues
LogLevel affects error log, not custom log format:
```apache # Error log (affected by LogLevel) ErrorLog /var/log/apache2/error.log LogLevel core:debug
# Custom log (not affected by LogLevel) CustomLog /var/log/apache2/access.log combined ```
Complete Debug Configuration
Basic Debug Setup
```apache # /etc/apache2/apache2.conf or /etc/httpd/conf/httpd.conf
# Global error log ErrorLog /var/log/apache2/error.log
# Enable debug for troubleshooting LogLevel debug
# Or module-specific LogLevel warn core:info ssl:debug proxy:debug rewrite:trace3 ```
Virtual Host Debug
```apache <VirtualHost *:80> ServerName example.com DocumentRoot /var/www/html/example
# Separate error log for this host ErrorLog /var/log/apache2/example-error.log CustomLog /var/log/apache2/example-access.log combined
# Debug level for this host only LogLevel debug
# Or conditional <IfModule mod_rewrite.c> LogLevel rewrite:trace3 </IfModule> </VirtualHost> ```
SSL Debug Configuration
```apache <VirtualHost *:443> ServerName example.com DocumentRoot /var/www/html/example
SSLEngine on SSLCertificateFile /etc/apache2/ssl/example.crt SSLCertificateKeyFile /etc/apache2/ssl/example.key
# SSL-specific debug ErrorLog /var/log/apache2/ssl-error.log LogLevel ssl:debug core:warn </VirtualHost> ```
Proxy Debug Configuration
```apache <VirtualHost *:80> ServerName proxy.example.com
ProxyPass / http://backend:8080/ ProxyPassReverse / http://backend:8080/
ErrorLog /var/log/apache2/proxy-error.log LogLevel proxy:debug proxy_http:debug </VirtualHost> ```
Verification
```bash # Test configuration apache2ctl configtest # or apachectl configtest
# Reload Apache systemctl reload apache2 # or systemctl reload httpd
# Check error log tail -f /var/log/apache2/error.log
# Verify LogLevel applied apache2ctl -t -D DUMP_MODULES | grep -i log
# Test with request curl http://localhost/ tail /var/log/apache2/error.log ```
Log Analysis
```bash # View recent errors tail -100 /var/log/apache2/error.log
# Filter by level grep -i "debug" /var/log/apache2/error.log grep -i "error" /var/log/apache2/error.log
# Count by severity grep -c "error" /var/log/apache2/error.log grep -c "warn" /var/log/apache2/error.log
# Real-time monitoring tail -f /var/log/apache2/error.log | grep --line-buffered "debug" ```
Log Rotation
```bash # Configure log rotation # /etc/logrotate.d/apache2
/var/log/apache2/*.log { daily missingok rotate 14 compress delaycompress notifempty create 640 www-data adm sharedscripts postrotate systemctl reload apache2 > /dev/null endscript } ```
Temporary Debug Enablement
```bash # Enable debug temporarily # Method 1: Command line apache2ctl -e debug
# Method 2: Environment variable export APACHE_LOG_LEVEL=debug apache2ctl start
# Method 3: Define parameter apache2ctl -D DEBUG -e debug ```
In configuration:
<IfDefine DEBUG>
LogLevel debug
</IfDefine>
<IfDefine !DEBUG>
LogLevel warn
</IfDefine>Start with debug:
apache2ctl -D DEBUG -k startPrevention
- 1.[ ] ErrorLog directive is set
- 2.[ ] LogLevel is in correct context
- 3.[ ] Log directory has correct permissions
- 4.[ ] No conflicting LogLevel directives
- 5.[ ] Using appropriate level for module
- 6.[ ] Configuration tested with apache2ctl configtest
- 7.[ ] Apache reloaded after changes
- 8.[ ] Log rotation configured
- 9.[ ] Monitoring logs for issues
- 10.[ ] Reduce LogLevel after troubleshooting
Related Articles
- [Nginx troubleshooting: Fix Lambda Permission Denied - Complete ](fix-lambda-permission-denied)
- [Nginx web server troubleshooting: Fix Client Max Body Size Large Upload Nginx Issue ](client-max-body-size-large-upload-nginx)
- [Fix Apache 502 Proxy Error](fix-apache-502-proxy-error)
- [Fix Cloudflare 502 Bad Gateway Error](fix-cloudflare-502-bad-gateway)
- [Fix Kong Gateway 500 Error](fix-kong-gateway-500-error)
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "TechArticle", "headline": "Fix Apache LogLevel Core Debug Configuration", "description": "Step-by-step guide to configure Apache LogLevel. Set core:debug, configure logging levels, and enable debug logging for Apache troubleshooting.", "url": "https://www.fixwikihub.com/fix-apache-loglevel-core-debug", "publisher": { "@type": "Organization", "name": "FixWikiHub", "url": "https://www.fixwikihub.com" }, "author": { "@type": "Person", "name": "FixWikiHub Editorial Team" }, "datePublished": "2026-04-27T10:12:00.000Z", "dateModified": "2026-04-27T10:12:00.000Z" } </script>