Apache / debug file.

I am using Django (3.13.12) with Apache.

In settings, Debug is set to False. Even after restarting Apache, I find a “debug.log” file in

/tmp/…apache…/tmp

This file contains more or less interesting things, which seem to be relevant of “small” problems

as not dangerous syntax errors.
BUT: my question is: why does this file exists, even whit Debug set to False ?

There are three different possibilities here, and without seeing 2-3 lines of the file, it’s impossible to tell what the origin of those logs are.

But, it’s important to remember that the DEBUG setting affects how Django behaves, not necessarily what is logged.

When you configure logging in Django, this is separate and independent of your DEBUG setting. Setting DEBUG=True does provide some additional logging to be performed, but setting DEBUG=False has no effect on other configured logging.

So, you could get log files from at least four different sources.

  1. Python logging within Django
  2. Logs generated by mod_wsgi
  3. Logs generated by Apache
  4. (less-likely) Logs created by third-party packages, modules, or apps being used by your project.

None of these would necessarily be limited or restricted by a DEBUG=False setting.