-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add async/sync setting to logging handler #1716
Conversation
Fixes #1532 |
LoggingOptions options = logging().getOptions(); | ||
MonitoredResource resource = MonitoredResource.of("gce_instance", | ||
ImmutableMap.of("project_id", options.getProjectId(), | ||
"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. |
@@ -296,6 +300,16 @@ Formatter getFormatterProperty(String name, Formatter defaultValue) { | |||
} | |||
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.
@@ -35,6 +33,7 @@ | |||
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
Two questions: