Add async/sync setting to logging handler#1716
Add async/sync setting to logging handler#1716michaelbausor merged 7 commits intogoogleapis:masterfrom
Conversation
|
Fixes #1532 |
| "instance_id", "instance", | ||
| "zone", "us-central1-a")); | ||
| LoggingHandler handler = new AsyncLoggingHandler(logName, options, resource); | ||
| LoggingHandler handler = new LoggingHandler(logName, options, resource); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| new ByteArrayInputStream( | ||
| "com.google.cloud.logging.LoggingHandler.writeLogMethod=SYNC".getBytes())); | ||
| } catch (Exception e) { | ||
| throw new RuntimeException(e); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| package com.google.cloud.logging; | ||
|
|
||
| public enum WriteLogMethod { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
PTAL. Also, should we have tests to make sure that settings in the properties file are read correctly? |
|
Yes, I think we should have a test for the properties file settings. |
| return Collections.emptyList(); | ||
| } | ||
|
|
||
| Synchronicity getSynchronicityProperty(String name, Synchronicity defaultValue) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| package com.google.cloud.logging; | ||
|
|
||
| public enum Synchronicity { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| import java.util.logging.LogRecord; | ||
| import java.util.logging.Logger; | ||
| import java.util.logging.SimpleFormatter; | ||
| import com.google.cloud.logging.Logging.WriteOption; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| package com.google.cloud.logging; | ||
|
|
||
| public enum Synchronicity { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
PTAL |
|
LGTM |
* Add async/sync setting to logging handler
…e to v2.25.3 (#1716) Co-authored-by: Cindy Peng <148148319+cindy-peng@users.noreply.github.com>
Two questions: