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 — Stop writing to '/var/log/app_engine/' and write logs to Stackdriver logging API by liyanhui1228 · Pull Request #3410 · googleapis/google-cloud-python

Conversation

@liyanhui1228

@liyanhui1228 liyanhui1228 commented May 12, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

For #2997 . Modified the AppEngineHandler to extend the CloudLoggingHandler and directly write logs to Stackdriver Logging API.

Screenshot of the gae_app log with AppEngineHandler:
test_gae_app_logging

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@liyanhui1228
liyanhui1228 requested review from dhermes, duggelz, theacodes and waprin May 12, 2017 18:46
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 12, 2017
waprin
waprin reviewed May 12, 2017
View reviewed changes
Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
transport=BackgroundThreadTransport,
resource=_GLOBAL_RESOURCE):
super(AppEngineHandler, self).__init__(client, name, transport)
self.resource=resource

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

waprin
waprin reviewed May 12, 2017
View reviewed changes
Comment thread logging/google/cloud/logging/handlers/transports/background_thread.py Outdated
self.stopped = True

def enqueue(self, record, message):
def enqueue(self, record, message, resource=_GLOBAL_RESOURCE):

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

waprin
waprin reviewed May 12, 2017
View reviewed changes
Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated

class AppEngineHandler(logging.handlers.RotatingFileHandler):
"""A handler that writes to the App Engine fluentd Stackdriver log file.
_GLOBAL_RESOURCE = Resource(type='global', labels={})

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

waprin
waprin reviewed May 12, 2017
View reviewed changes
Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
_LOG_FILE_COUNT = 3
DEFAULT_LOGGER_NAME = 'python'

EXCLUDED_LOGGER_DEFAULTS = ('google.cloud', 'oauth2client')

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

waprin
waprin reviewed May 12, 2017
View reviewed changes
Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
_LOG_PATH_TEMPLATE = '/var/log/app_engine/app.{pid}.json'
_MAX_LOG_BYTES = 128 * 1024 * 1024
_LOG_FILE_COUNT = 3
DEFAULT_LOGGER_NAME = 'python'

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

theacodes
theacodes suggested changes May 12, 2017
View reviewed changes
Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated

class AppEngineHandler(logging.handlers.RotatingFileHandler):
"""A handler that writes to the App Engine fluentd Stackdriver log file.
_GLOBAL_RESOURCE = Resource(type='global', labels={})

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
_LOG_FILE_COUNT = 3
DEFAULT_LOGGER_NAME = 'python'

EXCLUDED_LOGGER_DEFAULTS = ('google.cloud', 'oauth2client')

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
transport=BackgroundThreadTransport,
resource=_GLOBAL_RESOURCE):
super(AppEngineHandler, self).__init__(client, name, transport)
self.resource=resource

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
message = super(AppEngineHandler, self).format(record)
return format_stackdriver_json(record, message)
message = super(CloudLoggingHandler, self).format(record)
self.transport.send(record, message, self.resource)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/transports/background_thread.py Outdated
self.stopped = True

def enqueue(self, record, message):
def enqueue(self, record, message, resource=_GLOBAL_RESOURCE):

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liyanhui1228
liyanhui1228 force-pushed the yanhuil/2997 branch 2 times, most recently from f990734 to 5b79d48 Compare May 13, 2017 00:15
@liyanhui1228

liyanhui1228 commented May 13, 2017

Copy link
Copy Markdown
Contributor Author

Ready for another review, but still wait for Bill's comment about the default logName.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waprin

waprin commented May 13, 2017

Copy link
Copy Markdown
Contributor

You are right that shutdown part of logName is not quite right, I copied and pasted it from somewhere else. I am not sure exactly what the logName should be to be honest, I think it doesn't matter that much because the resource and labels are what puts it in the right place. I would guess its "projects/coinflow-demo/logs/appengine.googleapis.com%2Fapp" ? Might be worth pinging AppEngine or Logging people who can answer more confidently since I'm just guessing based on what I've seen a few other places.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes

theacodes commented May 13, 2017 via email

Copy link
Copy Markdown
Contributor
I wonder what happens if you just name it "app".
…
On Fri, May 12, 2017, 6:22 PM Bill Prin ***@***.***> wrote: You are right that shutdown part of logName is not quite right, I copied and pasted it from somewhere else. I am not sure exactly what the logName should be to be honest, I think it doesn't matter that much because the resource and labels are what puts it in the right place. I would guess its "projects/coinflow-demo/logs/appengine.googleapis.com%2Fapp" ? Might be worth pinging AppEngine or Logging people who can answer more confidently since I'm just guessing based on what I've seen a few other places. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#3410 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAPUcx213jZC7dp-NC5vYNeKOtQqcPXQks5r5QXFgaJpZM4NZpk_> .
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tmatsuo

tmatsuo commented May 13, 2017

Copy link
Copy Markdown
Contributor

FWIW, I'd recommend that you use app for the default logName. The logs with the correct monitored resource and if the logName is "projects/PROJECT_ID/logs/app", then it's available as "app" in the Logging UI drop down menu. PHP logging library is using app as the default logName.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

theacodes
theacodes suggested changes May 15, 2017
View reviewed changes
Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
_LOG_FILE_COUNT = 3
DEFAULT_LOGGER_NAME = 'python'

EXCLUDED_LOGGER_DEFAULTS = ('google.cloud', 'oauth2client')

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
GAE_RESOURCE = Resource(
type='gae_app',
labels={
'project_id': os.getenv('GCLOUD_PROJECT'),

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
def __init__(self, client,
name=DEFAULT_LOGGER_NAME,
transport=BackgroundThreadTransport,
resource=GAE_RESOURCE):

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
_LOG_PATH_TEMPLATE = '/var/log/app_engine/app.{pid}.json'
_MAX_LOG_BYTES = 128 * 1024 * 1024
_LOG_FILE_COUNT = 3
DEFAULT_LOGGER_NAME = 'python'

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/transports/sync.py Outdated
self.logger = client.logger(name)

def send(self, record, message):
def send(self, record, message, resource=_GLOBAL_RESOURCE):

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/test_app_engine.py Outdated
def test_ctor(self):
client = _Client(self.PROJECT)
handler = self._make_one(client, transport=_Transport)
self.assertEqual(handler.client, client)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/transports/test_background_thread.py Outdated
self.assertEqual(logger.name, name)

def test_send(self):
RESOURCE = Resource(

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/transports/test_sync.py Outdated
self.assertEqual(transport.logger.name, 'python_logger')

def test_send(self):
RESOURCE = Resource(

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/transports/test_sync.py Outdated

import logging
import unittest
from google.cloud.logging.resource import Resource

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver tseaver added the api: logging Issues related to the Cloud Logging API. label May 15, 2017
liyanhui1228 added 2 commits May 15, 2017 12:45
@liyanhui1228
Stop writing to '/var/log/app_engine/' and write logs to Stackdriver …
50bf434
…logging API
@liyanhui1228
Address jon and bill's comments
4d1924f
@liyanhui1228
liyanhui1228 force-pushed the yanhuil/2997 branch from 5b79d48 to c4704d6 Compare May 15, 2017 21:50
theacodes
theacodes suggested changes May 15, 2017
View reviewed changes
Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated

Logs to the well-known file that the fluentd sidecar container on App Engine
Flexible is configured to read from and send to Stackdriver Logging.
Send logs to Stackdriver Logging API.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
# This file is largely copied from:
# https://github.com/GoogleCloudPlatform/python-compat-runtime/blob/master
# /appengine-vmruntime/vmruntime/cloud_logging.py
GAE_PROJECT_ENV = 'GCLOUD_PROJECT'

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
message = super(AppEngineHandler, self).format(record)
return format_stackdriver_json(record, message)
def __init__(self, client,
name=EXCLUDED_LOGGER_DEFAULTS,

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/handlers.py Outdated
self.name = name
self.client = client
self.transport = transport(client, name)
self.resource=resource

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/handlers.py Outdated
"""
message = super(CloudLoggingHandler, self).format(record)
self.transport.send(record, message)
self.transport.send(record, message, self.resource)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/transports/background_thread.py Outdated
to the global resource type.
"""
self.worker.enqueue(record, message)
self.worker.enqueue(record, message, resource)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
labels={
'project_id': os.environ.get(GAE_PROJECT_ENV),
'module_id': os.environ.get('GAE_SERVICE'),
'version_id': os.environ.get('GAE_VERSION'),

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/test_app_engine.py Outdated
PROJECT = 'PROJECT'
from google.cloud.logging.resource import Resource

GAE_PROJECT_ENV = 'PROJECT'

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/test_app_engine.py Outdated
client = _Client(self.GAE_PROJECT_ENV)
handler = self._make_one(client, transport=_Transport)
self.assertEqual(handler.client, client)
self.assertEqual(handler.resource, self.GAE_RESOURCE)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liyanhui1228
liyanhui1228 force-pushed the yanhuil/2997 branch from c4704d6 to 4172e6d Compare May 16, 2017 00:15
@liyanhui1228
fix stuff
2591ef1
@liyanhui1228
liyanhui1228 force-pushed the yanhuil/2997 branch from 4172e6d to 2591ef1 Compare May 16, 2017 00:28
@tmatsuo

tmatsuo commented May 16, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Re: default logName

I recommended that we use app, but actually it can be anything. The request correlation feature just works with any logName as long as they have the same monitoredResource and the traceId. Both app and python are natural choice (shutdown is not though).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liyanhui1228
Change default logName
38f62d9
theacodes
theacodes suggested changes May 16, 2017
View reviewed changes

@theacodes theacodes left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks almost good to me, @dhermes can you take a look?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
class AppEngineHandler(logging.handlers.RotatingFileHandler):
"""A handler that writes to the App Engine fluentd Stackdriver log file.
class AppEngineHandler(CloudLoggingHandler):
"""A handler that directly makes Stackdriver logging API calls.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated

def __init__(self):
"""Construct the handler
This handler can be used to route Python standard logging messages directly

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
super(AppEngineHandler, self).__init__(self.filename,
maxBytes=_MAX_LOG_BYTES,
backupCount=_LOG_FILE_COUNT)
This handler supports both an asynchronous and synchronous transport.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
:param transport: Class for creating new transport objects. It should
extend from the base :class:`.Transport` type and
implement :meth`.Transport.send`. Defaults to
:class:`.BackgroundThreadTransport`. The other

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
"""
message = super(AppEngineHandler, self).format(record)
return format_stackdriver_json(record, message)
DEFAULT_LOGGER_NAME = 'app'

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated

def __init__(self, client,
transport=BackgroundThreadTransport):
super(AppEngineHandler, self).__init__(client, name=self.DEFAULT_LOGGER_NAME,

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
transport=transport, resource=self.gae_resource)

@property
def gae_resource(self):

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liyanhui1228
liyanhui1228 force-pushed the yanhuil/2997 branch from d43ae32 to d2d9628 Compare May 16, 2017 20:45
@googlebot

googlebot commented May 16, 2017

Copy link
Copy Markdown

CLAs look good, thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels May 16, 2017
@liyanhui1228

liyanhui1228 commented May 17, 2017

Copy link
Copy Markdown
Contributor Author

@dhermes @jonparrott Ready for another review or merge.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 17, 2017

Copy link
Copy Markdown
Contributor

I just re-built CircleCI, let's get it green (I realize the failure was due to error_reporting)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liyanhui1228

liyanhui1228 commented May 17, 2017

Copy link
Copy Markdown
Contributor Author

OK!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@duggelz
duggelz removed their request for review May 17, 2017 18:40
dhermes
dhermes reviewed May 17, 2017
View reviewed changes
Comment thread logging/google/cloud/logging/handlers/app_engine.py Outdated
"""
message = super(AppEngineHandler, self).format(record)
return format_stackdriver_json(record, message)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/handlers.py Outdated
option is :class:`.SyncTransport`.

:type resource: :class:`~google.cloud.logging.resource.Resource`
:param resource: (Optional) Monitored resource of the entry

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/test_app_engine.py
from google.cloud._testing import _Monkey
from google.cloud.logging.handlers import app_engine as _MUT
def test_constructor(self):
import mock

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/test_app_engine.py Outdated
class _Transport(object):

def __init__(self, client, name):
pass

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/transports/test_background_thread.py Outdated


class _Batch(object):
from google.cloud.logging.logger import _GLOBAL_RESOURCE

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/tests/unit/handlers/transports/test_background_thread.py
def log_struct(self, info, severity=logging.INFO):
self.log_struct_called_with = (info, severity)
def log_struct(self, info, severity=logging.INFO, resource=_GLOBAL_RESOURCE):
self.log_struct_called_with = (info, severity, resource)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 17, 2017

Copy link
Copy Markdown
Contributor

@liyanhui1228 Looks like you --force pushed over some changes I made yesterday? Pre #3422, the build will fail, so I rebased your branch. There was also a tiny docs error that I made a commit to resolve (error doesn't seem to be present any longer, just ran docs locally).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liyanhui1228

liyanhui1228 commented May 17, 2017

Copy link
Copy Markdown
Contributor Author

Yeah did you rebase my branch just now? I didn't find it in git log.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liyanhui1228
fix style
1b3d91e
@dhermes

dhermes commented May 17, 2017

Copy link
Copy Markdown
Contributor

@liyanhui1228 No I didn't do it just now, but a rebase won't show up in your logs (other than the fact that all the commit hashes will be different and the first commit will have a new parent)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 17, 2017

Copy link
Copy Markdown
Contributor

This LGTM. We should wait until we can get a green build? WDYT @jonparrott?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes

theacodes commented May 17, 2017

Copy link
Copy Markdown
Contributor

We should wait until we can get a green build?

Yes. I'll give it another review while we wait for CI.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

theacodes
theacodes approved these changes May 17, 2017
View reviewed changes
@theacodes

theacodes commented May 17, 2017

Copy link
Copy Markdown
Contributor

@dhermes bigquery system tests are failing?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes

theacodes commented May 17, 2017

Copy link
Copy Markdown
Contributor

Confirmed with @dhermes over chat that bigquery tests are borked - merging based on local verification of tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes
theacodes merged commit cce9c99 into master May 17, 2017
@theacodes
theacodes deleted the yanhuil/2997 branch May 17, 2017 22:15
@dhermes

dhermes commented May 17, 2017

Copy link
Copy Markdown
Contributor

They are green sometimes but I've seen them fail 4+ times on this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced May 17, 2017
Send trace context with logs from web applications #3359
Closed
Stop writing to /var/log/app_engine/ #2997
Closed
@tseaver

tseaver commented May 19, 2017

Copy link
Copy Markdown
Contributor

@jonparrott It looks like you merged this PR with failing coverage in the logging package:

$ cd logging
$ nox
...
Name                                                            Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------------------------------------------------
google/cloud/logging/__init__.py                                    7      0      0      0   100%
google/cloud/logging/_gax.py                                      190      0     28      0   100%
google/cloud/logging/_helpers.py                                   12      0      6      0   100%
google/cloud/logging/_http.py                                      98      0     16      0   100%
google/cloud/logging/client.py                                     79      0     20      0   100%
google/cloud/logging/entries.py                                    57      0     10      0   100%
google/cloud/logging/handlers/__init__.py                           6      0      0      0   100%
google/cloud/logging/handlers/_helpers.py                           7      0      0      0   100%
google/cloud/logging/handlers/app_engine.py                        15      0      0      0   100%
google/cloud/logging/handlers/container_engine.py                   7      0      0      0   100%
google/cloud/logging/handlers/handlers.py                          26      0      2      0   100%
google/cloud/logging/handlers/transports/__init__.py                5      0      0      0   100%
google/cloud/logging/handlers/transports/background_thread.py      98      0     24      0   100%
google/cloud/logging/handlers/transports/base.py                    5      0      0      0   100%
google/cloud/logging/handlers/transports/sync.py                    8      0      0      0   100%
google/cloud/logging/logger.py                                    116      0     50      0   100%
google/cloud/logging/metric.py                                     46      0      2      0   100%
google/cloud/logging/resource.py                                    8      0      0      0   100%
google/cloud/logging/sink.py                                       46      0      2      0   100%
tests/unit/__init__.py                                              0      0      0      0   100%
tests/unit/handlers/__init__.py                                     0      0      0      0   100%
tests/unit/handlers/test_app_engine.py                             40      0      0      0   100%
tests/unit/handlers/test_container_engine.py                       19      0      0      0   100%
tests/unit/handlers/test_handlers.py                               60      0      2      0   100%
tests/unit/handlers/transports/__init__.py                          0      0      0      0   100%
tests/unit/handlers/transports/test_background_thread.py          200      0      4      1    99%   293->296
tests/unit/handlers/transports/test_base.py                        15      0      0      0   100%
tests/unit/handlers/transports/test_sync.py                        42      0      0      0   100%
tests/unit/test__gax.py                                           989      0     48      0   100%
tests/unit/test__helpers.py                                        32      0      0      0   100%
tests/unit/test__http.py                                          481      0      2      0   100%
tests/unit/test_client.py                                         375      0      0      0   100%
tests/unit/test_entries.py                                        190      0      0      0   100%
tests/unit/test_logger.py                                         506      0      0      0   100%
tests/unit/test_metric.py                                         152      0      0      0   100%
tests/unit/test_sink.py                                           153      0      0      0   100%
-----------------------------------------------------------------------------------------------------------
TOTAL                                                            4090      0    216      1    99%
nox > Command coverage report --show-missing --fail-under=100 failed with exit code 2
nox > Session cover failed. :(
nox > Ran multiple sessions:
nox > * unit_tests(python_version='2.7'): passed
nox > * unit_tests(python_version='3.4'): passed
nox > * unit_tests(python_version='3.5'): passed
nox > * unit_tests(python_version='3.6'): passed
nox > * system_tests(python_version='2.7'): passed
nox > * system_tests(python_version='3.6'): passed
nox > * lint: passed
nox > * lint_setup_py: passed
nox > * cover: failed

We need to quit running tests for the unaffected packages ASAP. Having BQ back-end slow down shouldn't break our logging CI.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes

theacodes commented May 19, 2017 via email

Copy link
Copy Markdown
Contributor
Agreed. I'll send a PR to address coverage when I return from pycon next week.
…
On Fri, May 19, 2017, 1:24 PM Tres Seaver ***@***.***> wrote: @jonparrott <https://github.com/jonparrott> It looks like you merged this PR with failing coverage *in the logging package*: $ cd logging $ nox ... Name Stmts Miss Branch BrPart Cover Missing ----------------------------------------------------------------------------------------------------------- google/cloud/logging/__init__.py 7 0 0 0 100% google/cloud/logging/_gax.py 190 0 28 0 100% google/cloud/logging/_helpers.py 12 0 6 0 100% google/cloud/logging/_http.py 98 0 16 0 100% google/cloud/logging/client.py 79 0 20 0 100% google/cloud/logging/entries.py 57 0 10 0 100% google/cloud/logging/handlers/__init__.py 6 0 0 0 100% google/cloud/logging/handlers/_helpers.py 7 0 0 0 100% google/cloud/logging/handlers/app_engine.py 15 0 0 0 100% google/cloud/logging/handlers/container_engine.py 7 0 0 0 100% google/cloud/logging/handlers/handlers.py 26 0 2 0 100% google/cloud/logging/handlers/transports/__init__.py 5 0 0 0 100% google/cloud/logging/handlers/transports/background_thread.py 98 0 24 0 100% google/cloud/logging/handlers/transports/base.py 5 0 0 0 100% google/cloud/logging/handlers/transports/sync.py 8 0 0 0 100% google/cloud/logging/logger.py 116 0 50 0 100% google/cloud/logging/metric.py 46 0 2 0 100% google/cloud/logging/resource.py 8 0 0 0 100% google/cloud/logging/sink.py 46 0 2 0 100% tests/unit/__init__.py 0 0 0 0 100% tests/unit/handlers/__init__.py 0 0 0 0 100% tests/unit/handlers/test_app_engine.py 40 0 0 0 100% tests/unit/handlers/test_container_engine.py 19 0 0 0 100% tests/unit/handlers/test_handlers.py 60 0 2 0 100% tests/unit/handlers/transports/__init__.py 0 0 0 0 100% tests/unit/handlers/transports/test_background_thread.py 200 0 4 1 99% 293->296 tests/unit/handlers/transports/test_base.py 15 0 0 0 100% tests/unit/handlers/transports/test_sync.py 42 0 0 0 100% tests/unit/test__gax.py 989 0 48 0 100% tests/unit/test__helpers.py 32 0 0 0 100% tests/unit/test__http.py 481 0 2 0 100% tests/unit/test_client.py 375 0 0 0 100% tests/unit/test_entries.py 190 0 0 0 100% tests/unit/test_logger.py 506 0 0 0 100% tests/unit/test_metric.py 152 0 0 0 100% tests/unit/test_sink.py 153 0 0 0 100% ----------------------------------------------------------------------------------------------------------- TOTAL 4090 0 216 1 99% nox > Command coverage report --show-missing --fail-under=100 failed with exit code 2 nox > Session cover failed. :( nox > Ran multiple sessions: nox > * unit_tests(python_version='2.7'): passed nox > * unit_tests(python_version='3.4'): passed nox > * unit_tests(python_version='3.5'): passed nox > * unit_tests(python_version='3.6'): passed nox > * system_tests(python_version='2.7'): passed nox > * system_tests(python_version='3.6'): passed nox > * lint: passed nox > * lint_setup_py: passed nox > * cover: failed We need to quit running tests for the unaffected packages ASAP. Having BQ back-end slow down shouldn't break our logging CI. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#3410 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAPUc6L81Rgawf1tF7Fqka6T1kPzbJgcks5r7fprgaJpZM4NZpk_> .
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented May 19, 2017

Copy link
Copy Markdown
Contributor

I just merged #3445, which fixes the immediate issue (by suppressing the uncovered branch nested down in the tests).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes

theacodes commented May 19, 2017 via email

Copy link
Copy Markdown
Contributor
Awesome, thank you.
…
On Fri, May 19, 2017, 1:40 PM Tres Seaver ***@***.***> wrote: I just merged #3445 <#3445>, which fixes the immediate issue (by suppressing the uncovered branch nested down in the tests). — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#3410 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAPUcwyvcil1FXi9vUAPdiJ1vjpaGRpKks5r7f5HgaJpZM4NZpk_> .
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver tseaver mentioned this pull request Jun 26, 2017
Prep logging-1.1.0 release. #3528
Merged
@bonfante bonfante mentioned this pull request Jul 10, 2018
There is no existing directory at "/var/log/app_engine" and its not buildab GoogleCloudPlatform/php-docker#452
Open
parthea pushed a commit that referenced this pull request Oct 21, 2023
@renovate-bot @busunkim96
Update dependency google-cloud-kms to v1.4.0 [(#3410)](GoogleCloudPla…
82bd0d6
…tform/python-docs-samples#3410)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-kms](https://togithub.com/googleapis/python-kms) | minor | `==1.3.0` -> `==1.4.0` |

---

### Release Notes

<details>
<summary>googleapis/python-kms</summary>

### [`v1.4.0`](https://togithub.com/googleapis/python-kms/blob/master/CHANGELOG.md#&#8203;140-httpswwwgithubcomgoogleapispython-kmscomparev130v140-2020-04-14)

[Compare Source](https://togithub.com/googleapis/python-kms/compare/v1.3.0...v1.4.0)

##### Features

-   add support for external key manager (via synth) ([#&#8203;8](https://www.github.com/googleapis/python-kms/issues/8)) ([4077fc8](https://www.github.com/googleapis/python-kms/commit/4077fc89943cc09d489d44c05efcf9cab61cdbaf))

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
parthea pushed a commit that referenced this pull request Nov 24, 2025
@liyanhui1228 Jon Wayne Parrott
Stop writing to '/var/log/app_engine/' and write logs to Stackdriver …
54395b9
…logging API (#3410)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

3 more reviewers
@dhermes dhermes dhermes left review comments
@waprin waprin waprin left review comments
@theacodes theacodes theacodes approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: logging Issues related to the Cloud Logging API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@liyanhui1228 @waprin @theacodes @tmatsuo @googlebot @dhermes @tseaver
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.