Hi,
Coming from java, being familiar with logback I used to do
try {
...
catch (Exception e) {
log("Error at X", e);
}
I would like the same functionality of being able to log the exception and the stacktrace into a file.
How would you recommend me implementing this?
Currently using boto logging infrastructre, boto.log.info(...)
I've looked at some options and found out I can access the actual exception details using this code:
import sys
try:
1/0
except:
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback.print_exception(exc_type, exc_value, exc_traceback)
I would like to somehow get the string print_exception() throws to stdout so that I can log it.
Thank you,
Maxim.