-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should we add a stdlib logging handler which writes entries to the logging API? #1497
Comments
/cc @andrewsg This is probably a yes, as we'd like to have this for the Python runtimes. |
👍 |
+1 from me too. I believe we do this with Node also. |
Sorry I didn't find this issue. I was saying that I found a working version here: https://medium.com/google-cloud/cloud-logging-though-a-python-log-handler-a3fbeaf14704#.mcrqgtkhh |
As mentioned in that article:
If we decide to do this here (also probably something to consider in node as well) we should be really careful about every logging statement making an API call. Raven uses a separate thread to asyncronously send logs, and also has other transports that play well with stuff like gevent. |
Because of that, I would propose it to be a handler configured by default to If we want to do more, we can implement another logger, threaded one, where the I would first start creating the proposed handler, and then maybe implement a ThreadedHandler or something like that that spins threads on logging requests. |
Of course, if we go that way, we should also create an Asyncio based handler. But I see the basic one as a first step, documenting properly the possible performance problem is misused. |
I'd like to see this get done, because right now logging on flex doesn't capture log levels etc and it's really pretty easy to fix. @andrewsg showed me the compat handler which with almost no modifications at least gets the log level right. I think what we want is:
I would really like to see this done as we fill out Stackdriver section of Python page, will work on a PR if nobody else is working on it and people are ok with the plan. |
@jonparrott Can you give me an idea of where this stands (in importance, progress, and difficulty)? |
This is done. |
The handler would be similar to the syslog handler in the stdlib. It could be configured via an INI file, e.g.:
On a GCE / GAE host, the stdlib's
SyslogHandler
would work without this feature.The text was updated successfully, but these errors were encountered: