Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:44:27+00:00 2026-06-01T04:44:27+00:00

In settings.py I have setup a way to log my messages like this: logging.basicConfig(

  • 0

In settings.py I have setup a way to log my messages like this:

logging.basicConfig(
    level = logging.DEBUG,
    format = '%(asctime)s %(levelname)s %(message)s',
    filename = 'log/sdout.log',
    filemode = 'a'
)

However sometimes django fails silently. Like in the case of signals. My problem is that at my work pc everything works great. At my production server something is wrong. I know the place of the exception. I just can’t see why it fails.

So I placed something like this:

logging.debug('before error') #this is printed out
try:
    end_date = start_date.date() + relativedelta(months = +month_diff)
    next_billing_date = start_date.date() + datetime.timedelta(7)
except :
    import sys, traceback
    traceback.print_exc(file=sys.stdout)

logging.debug('after error') #I never get to that part. 

EDIT: The above snippet lies in my models.py called when I receive a POST from paypal

After failure I try to look into my apache error logs and my logging file but see no errors, whatsoever.

How can I see what is wrong with this code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:44:28+00:00Added an answer on June 1, 2026 at 4:44 am

    I would first recommended sentry – if you can’t install it due to system restrictions – it is now available as a hosted service at getsentry.com and like most such services, there is a free tier.

    However, the issue could be that WSGI by default blocks writing to stdout, as detailed in the documentation wiki under application issues.

    There are few workarounds posted at that page, but the one I would start with is to add the following to your WSGI configuration:

    WSGIRestrictStdout Off

    See if that helps with error logging.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup my schedule.rb file as follows. set :cron_log, /log/cron_log.log if Rails.env.development? every
I have yet to find a way of setting up Python logging with Django
We have SQL Server database setup. We are setting up a replication scenarios where
For my project I have settings that I added through the Settings in the
I have a settings file in my Winforms application called Settings.settings with a partial
I have some settings I need in a Javascript file -- servers to connect
I have Application settings stored under HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany branch. Settings must be same for different
I have various settings in my ccnet.config file and wish to pass them to
I have some settings in my app.config which I intend to be 'global' -
I have a settings.php file with parametric variables and a functions.php with well, some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.