[debugging] How to enable loglevel debug on Apache2 server

My error.log contains:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

I replaced loglevel on apache config file:

LogLevel debug

After restarting, I'm getting the same error message without what could be called "a backtrace". As I understand there should be those 10 lines of redirects generated by mod_rewrite regex.

After searching all over the internet I've found plenty of explanations of loglevel and mod_rewrite, but not a word of how to make loglevel debug work.

Any ideas?

This question is related to debugging apache2 error-logging

The answer is


Do note that on newer Apache versions the RewriteLog and RewriteLogLevel have been removed, and in fact will now trigger an error when trying to start Apache (at least on my XAMPP installation with Apache 2.4.2):

AH00526: Syntax error on line xx of path/to/config/file.conf: Invalid command 'RewriteLog', perhaps misspelled or defined by a module not included in the server configuration`

Instead, you're now supposed to use the general LogLevel directive, with a level of trace1 up to trace8. 'debug' didn't display any rewrite messages in the log for me.

Example: LogLevel warn rewrite:trace3

For the official documentation, see here.

Of course this also means that now your rewrite logs will be written in the general error log file and you'll have to sort them out yourself.


You need to use LogLevel rewrite:trace3 to your httpd.conf in newer version http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#logging


Examples related to debugging

How do I enable logging for Spring Security? How to run or debug php on Visual Studio Code (VSCode) How do you debug React Native? How do I debug "Error: spawn ENOENT" on node.js? How can I inspect the file system of a failed `docker build`? Swift: print() vs println() vs NSLog() JavaScript console.log causes error: "Synchronous XMLHttpRequest on the main thread is deprecated..." How to debug Spring Boot application with Eclipse? Unfortunately MyApp has stopped. How can I solve this? 500 internal server error, how to debug

Examples related to apache2

Only variable references should be returned by reference - Codeigniter 413 Request Entity Too Large - File Upload Issue Site does not exist error for a2ensite How to convert .pem into .key? Apache: Restrict access to specific source IP inside virtual host CodeIgniter removing index.php from url Failed Apache2 start, no error log Apache2: 'AH01630: client denied by server configuration' what does it mean "(include_path='.:/usr/share/pear:/usr/share/php')"? How to check is Apache2 is stopped in Ubuntu?

Examples related to error-logging

Making Python loggers output all messages to stdout in addition to log file "[notice] child pid XXXX exit signal Segmentation fault (11)" in apache error.log How to enable loglevel debug on Apache2 server Internal Error 500 Apache, but nothing in the logs? Print PHP Call Stack How should you diagnose the error SEHException - External component has thrown an exception Error handling in Bash