You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/.repo-metadata.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,5 +14,5 @@
14
14
"default_version": "v1",
15
15
"codeowner_team": "@googleapis/spanner-team",
16
16
"api_shortname": "spanner",
17
-
"api_description": "is a fully managed, mission-critical, \nrelational database service that offers transactional consistency at global scale, \nschemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication \nfor high availability.\n\nBe sure to activate the Cloud Spanner API on the Developer's Console to\nuse Cloud Spanner from your project."
17
+
"api_description": "is the world's first fully managed relational database service \nto offer both strong consistency and horizontal scalability for \nmission-critical online transaction processing (OLTP) applications. With Cloud \nSpanner you enjoy all the traditional benefits of a relational database; but \nunlike any other relational database service, Cloud Spanner scales horizontally \nto hundreds or thousands of servers to handle the biggest transactional \nworkloads."
This library uses the standard Python :code:`logging` functionality to log some RPC events that could be of interest for debugging and monitoring purposes.
301
+
Note the following:
302
+
303
+
#. Logs may contain sensitive information. Take care to **restrict access to the logs** if they are saved, whether it be on local storage or on Google Cloud Logging.
304
+
#. Google may refine the occurrence, level, and content of various log messages in this library without flagging such changes as breaking. **Do not depend on immutability of the logging events**.
305
+
#. By default, the logging events from this library are not handled. You must **explicitly configure log handling** using one of the mechanisms below.
306
+
307
+
Simple, environment-based configuration
308
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
309
+
310
+
To enable logging for this library without any changes in your code, set the :code:`GOOGLE_SDK_PYTHON_LOGGING_SCOPE` environment variable to a valid Google
311
+
logging scope. This configures handling of logging events (at level :code:`logging.DEBUG` or higher) from this library in a default manner, emitting the logged
312
+
messages in a structured format. It does not currently allow customizing the logging levels captured nor the handlers, formatters, etc. used for any logging
313
+
event.
314
+
315
+
A logging scope is a period-separated namespace that begins with :code:`google`, identifying the Python module or package to log.
316
+
317
+
- Valid logging scopes: :code:`google`, :code:`google.cloud.asset.v1`, :code:`google.api`, :code:`google.auth`, etc.
318
+
- Invalid logging scopes: :code:`foo`, :code:`123`, etc.
319
+
320
+
**NOTE**: If the logging scope is invalid, the library does not set up any logging handlers.
321
+
322
+
Environment-Based Examples
323
+
^^^^^^^^^^^^^^^^^^^^^^^^^^
324
+
325
+
- Enabling the default handler for all Google-based loggers
326
+
327
+
.. code-block:: console
328
+
329
+
export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google
330
+
331
+
- Enabling the default handler for a specific Google module (for a client library called :code:`library_v1`):
#. Regardless of which of the mechanisms above you use to configure logging for this library, by default logging events are not propagated up to the root
374
+
logger from the `google`-level logger. If you need the events to be propagated to the root logger, you must explicitly set
375
+
:code:`logging.getLogger("google").propagate = True` in your code.
376
+
#. You can mix the different logging configurations above for different Google modules. For example, you may want use a code-based logging configuration for
377
+
one library, but decide you need to also set up environment-based logging configuration for another library.
378
+
379
+
#. If you attempt to use both code-based and environment-based configuration for the same module, the environment-based configuration will be ineffectual
380
+
if the code -based configuration gets applied first.
381
+
382
+
#. The Google-specific logging configurations (default handlers for environment-based configuration; not propagating logging events to the root logger) get
383
+
executed the first time *any* client library is instantiated in your application, and only if the affected loggers have not been previously configured.
0 commit comments