Python Services and excepthook (not working)

Discussion in 'Python' started by Larry Bates, Mar 5, 2004.

  1. Larry Bates

    Larry Bates Guest

    In an attempt to catch all exceptions that might
    happen in my program, I have set an excepthook
    so that I can catch the exception, get the
    traceback and log it to a file. This works like
    a charm for "normal" Python programs. I have
    just begun to write Python services and this
    methodology doesn't seem to work any more. It
    appears that some other function is taking over
    my excepthook and writes the traceback to the
    Event Log (not a bad thing, just not what I want).
    I would like to get back control so I can log
    the exception to my log file (and email a message
    to the administrator).

    Anybody got an idea how I might accomplish this?

    Thanks in advance,
    Larry Bates
    Syscon, Inc.
     
    Larry Bates, Mar 5, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Follower
    Replies:
    1
    Views:
    3,298
    Jeremy Fincher
    Oct 27, 2003
  2. Josh Close
    Replies:
    1
    Views:
    411
    Larry Bates
    Jul 23, 2004
  3. Lunchtimemama

    Problem overriding sys.excepthook

    Lunchtimemama, Jan 1, 2006, in forum: Python
    Replies:
    6
    Views:
    517
    Lunchtimemama
    Jan 3, 2006
  4. Jesus Rivero - (Neurogeek)

    Threads and sys.excepthook

    Jesus Rivero - (Neurogeek), Mar 28, 2006, in forum: Python
    Replies:
    1
    Views:
    496
    Jonathan Ellis
    Mar 28, 2006
  5. Pramod TK
    Replies:
    0
    Views:
    358
    Pramod TK
    Apr 26, 2006
  6. Larry Bates

    Python 2.5b2 and excepthook problem

    Larry Bates, Aug 7, 2006, in forum: Python
    Replies:
    0
    Views:
    369
    Larry Bates
    Aug 7, 2006
  7. ian

    sys.excepthook and threads

    ian, Mar 27, 2007, in forum: Python
    Replies:
    1
    Views:
    382
    Dr. Peer Griebel
    Apr 12, 2007
  8. Dave Cook
    Replies:
    2
    Views:
    392
    Philipp Hagemeister
    Jun 13, 2012
Loading...