开发者

Google App Engine log username with custom auth

I use a custom authentication for my python Go开发者_开发百科ogle App Engine app. There is a "username" field in the log for every request, which is empty now. Is it possible to add the name of the authenticated user to the log? I would not like to add an "user: %s" % user.name manually to all of my logging.xxx statements.

Thanks.


Add a single logging.debug call in your authentication code to log the current user. Logs are shown aggregated by request, so you'll always be able to see the user associated with that request.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜