Skip to content

feat: add writeSynchronicity flag to appender configuration#542

Merged
simonz130 merged 4 commits intomasterfrom
minherz/fix-537
Sep 17, 2021
Merged

feat: add writeSynchronicity flag to appender configuration#542
simonz130 merged 4 commits intomasterfrom
minherz/fix-537

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 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).

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.

2 participants