GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Should we add a stdlib logging handler which writes entries to the logging API? · Issue #1497 · googleapis/google-cloud-python

Should we add a stdlib logging handler which writes entries to the logging API? #1497

New issue
Copy link
New issue
Copy link
Closed
Closed
Should we add a stdlib logging handler which writes entries to the logging API?#1497
Copy link
Assignees
theacodes
Labels
api: loggingIssues related to the Cloud Logging API.priority: p2Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.

Description

@tseaver
tseaver
opened on Feb 19, 2016
Issue body actions

The handler would be similar to the syslog handler in the stdlib. It could be configured via an INI file, e.g.:

[handler_gcloud]
class=gcloud.logging.handler.APIHandler
level=INFO
log_name=my-log

On a GCE / GAE host, the stdlib's SyslogHandler would work without this feature.

Activity

  1. tseaver
    added
    type: questionRequest for information or clarification. Not an issue.
    api: loggingIssues related to the Cloud Logging API.
    on Feb 19, 2016
  2. theacodes commented on Feb 19, 2016

    @theacodes
    theacodes
    on Feb 19, 2016
    Contributor
    More actions

    /cc @andrewsg

    This is probably a yes, as we'd like to have this for the Python runtimes.

  3. dhermes commented on Feb 20, 2016

    @dhermes
    dhermes
    on Feb 20, 2016
    Contributor
    More actions

    👍

  4. jgeewax commented on Feb 21, 2016

    @jgeewax
    jgeewax
    on Feb 21, 2016
    Contributor
    More actions

    +1 from me too. I believe we do this with Node also.

  5. txomon commented on May 26, 2016

    @txomon
    txomon
    on May 26, 2016
    More actions

    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

  6. theacodes commented on May 26, 2016

    @theacodes
    theacodes
    on May 26, 2016
    Contributor
    More actions

    As mentioned in that article:

    I have to point out that for each log call an API call is done which can impact performance. But as a lot of Python scripts are written for automation task that are not performance critical this should not be a problem to them.

    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.

  7. txomon commented on May 26, 2016

    @txomon
    txomon
    on May 26, 2016
    More actions

    Because of that, I would propose it to be a handler configured by default to logging.ERROR level.

    If we want to do more, we can implement another logger, threaded one, where the handle() method launches a thread instead of doing the work itself. I would see this as a different functionality though.

    I would first start creating the proposed handler, and then maybe implement a ThreadedHandler or something like that that spins threads on logging requests.

  8. txomon commented on May 26, 2016

    @txomon
    txomon
    on May 26, 2016
    More actions

    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.

  9. waprin commented on Jun 20, 2016

    @waprin
    waprin
    on Jun 20, 2016
    Contributor
    More actions

    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:

    1. Auto-detection if you're in a flex environment and writing to the expected log file for fluentd to pick up.
    2. Config option (maybe auto-detect?) for people who have installed the google-fluentd handler on a VM
    3. Fallback to writing to the logging API similar to the medium post (except using this lib instead of google api client). Start with a synchronous handler but leave it easy to swap in asynchronous transports.
    4. For messages of severity error or greater, format the log entry in such a way that it gets properly picked up Cloud Error Reporting.
    5. Optional hook that installs a global exception handler that will log stacktraces to Cloud Error Reporting

    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

  10. lukesneeringer
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 19, 2017
  11. lukesneeringer commented on Aug 11, 2017

    @lukesneeringer
    lukesneeringer
    on Aug 11, 2017
    Contributor
    More actions

    @jonparrott Can you give me an idea of where this stands (in importance, progress, and difficulty)?

  12. theacodes commented on Aug 11, 2017

    @theacodes
    theacodes
    on Aug 11, 2017
    Contributor
    More actions

    This is done.

  13. theacodes
    closed this as completedon Aug 11, 2017
  14. JustinBeckwith
    assigned
    theacodes
    on Feb 1, 2021
  15. parthea
    added 2 commits that reference this issue on Nov 24, 2025

    chore(deps): update dependency setuptools to v65.6.3 (#1497)

    488eb11

    chore: update token (#1497)

    9ab72a8
  16. parthea
    added 2 commits that reference this issue on Mar 9, 2026

    chore: update the source path in owlbot.yaml (#1497)

    e0920b4

    chore: librarian release pull request: 20260213T101303Z (#1497)

    d4cee61
  17. parthea
    added a commit that references this issue on Apr 1, 2026

    feat: Allow iloc to support lists of negative indices (#1497)

    84e7455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @theacodes
    theacodes

Labels

api: loggingIssues related to the Cloud Logging API.priority: p2Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.