Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm setting up Django with mod_wsgi on Apache and I've been debugging the errors that appear in the error log. However, I can't always get it to create a log.

My process is goes something like this. It's pure guessing right now, but every 10-15 minutes of trying, I'm able to make the log appear.

  • open up the url a couple times to get Internal Server Error in the browser
  • restart Apache for good measure
  • refresh the directory in Filezilla
  • close and reopen PuTTY and Filezilla
  • repeat until the log appears, then delete it, so you know the new log file contains only new errors

Terrible logic, I know. I'm just wondering, what actually causes the error to log or not log?

share|improve this question

1 Answer 1

First of all, you shouldn't be deleting the logs, you should be emptying them. You can do this by either piping nothing into the file, or overwriting it with a blank file. The first being best. If you are determined to delete the file you should restart the service, this will generate a new log properly. Deleting an open file like you are doing messes with the file accounting for both the webserver process and the OS. This should give you a bit more consistency.

As for "Internal Server Error" this is a generic term. You need to use the HTTP code so that it is clear on what error the browser is actually getting. IE 500, 501, 400, 404, etc. Also be syre that you are examining all log files for the webserver process. Foe example in Apache there may be one for that particular vhost for access logs ie. mydomain.com.aceess.log an one for errors ie. mydomain.com.error.log as well as generic access.log and error.log, and othervhost.access.log etc.

Your lack of specifics makes it hard to help you with your issue.

share|improve this answer
    
Thanks for answering. Can you be more specific on piping? It's a 500 error, which seems to be caused by a large number of things, so not sure how much that helps. How can I find a list of log files? Thanks! –  User Jun 27 at 23:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.