Skip to content
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

feat: add writeSynchronicity flag to appender configuration #542

Merged
merged 4 commits into from Sep 17, 2021

Conversation

minherz
Copy link
Contributor

@minherz minherz commented Sep 16, 2021

Adds the writeSynchronicity flag to control synchronous writing of the log entries by the logging appender.

It is done as a partial work on resolving #537 .

add new adapter configuration to allow setting writeSynchronicity
remove debug prints
add option description into class javadoc
setup default value of the instance
@minherz minherz requested a review from a team as a code owner September 16, 2021 15:51
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 16, 2021
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/java-logging-logback API. label Sep 16, 2021
@minherz minherz added lang: java Issues specific to Java. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Sep 16, 2021
*
* @param log flag
*/
public void setWriteSynchronicity(String flag) {

Choose a reason for hiding this comment

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

Nit: should this be enum instead of string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The parameter is a value of the enum. There is no simple way to define specific type for logback appender parameters in the configuration. The value is parsed and in a case of failure the fallback is to the default value (ASYNC).

@@ -161,6 +181,12 @@ String getLogName() {
return (log != null) ? log : "java.log";
}

public String getWriteSynchronicity() {

Choose a reason for hiding this comment

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

Why not returning the enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be symetric with setWriteSynchronicity()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/java-logging-logback API. cla: yes This human has signed the Contributor License Agreement. lang: java Issues specific to Java.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants