I am using
eventlet with Python to spawn some threads. I am using
eventlet.spawn_n(). I can see from the implementation here that it prints a stack trace if the method you run throws an exception: https://github.com/eventlet/eventlet/blob/79292bd16a6a1384d8c3d11bcefa40eb53bbeae4/eventlet/greenpool.py#L93
This stack trace is going to stderr. But the logging for everything else in my program goes to a file using
WatchedFileHandler. This causes the stack traces to not be shown in the the log file where the rest of the logging for my application takes place which is causing some problems.
Is there a way to get the stack traces from eventlet to print to the same file that the rest of my application logs to rather than printing to stderr?
Here is the logging configuration I currently use:
[loggers] keys = root [handlers] keys = watchedfile [formatters] keys = default [logger_root] level = INFO handlers = watchedfile [handler_watchedfile] class = handlers.WatchedFileHandler args = ('my_log.txt',) formatter = default [formatter_default] format = %(asctime)s %(levelname)s [%(name)s] %(pathname)s:%(funcName)s:%(lineno)s %(message)s