Created
March 16, 2015 20:47
-
-
Save mitchty/1c60c9f4e4df515eeb08 to your computer and use it in GitHub Desktop.
Revisions
-
mitchty created this gist
Mar 16, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ Per request uuid tracking in flask, or at least one way to go about it. In create_app() @app.before_request def add_uuid_to_request_object(): request.uuid = uuid.uuid4() Then in your route or MethodViews, I'm using MethodViews: class SomeAPI(MethodView): def get(self): current_app.loggers.debug("%s etc..." % request.uuid)