You probably want the stacktrace no? `logging.exception` should give you that. Also you'd want the doc id but I guess you can get that from the previous print statement.