Skip to content

Commit 60a00b3

Browse files
committed
Mention logging.properties in handler-related javadoc
1 parent 99a6ae1 commit 60a00b3

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

gcloud-java-examples/src/main/java/com/google/cloud/examples/logging/snippets/AddLoggingHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
* A snippet showing how to use {@link java.util.logging.Logger} to log entries to Stackdriver
2525
* Logging. The snippet shows how to install a Stackdriver Logging handler using
2626
* {@link com.google.cloud.logging.LoggingHandler#addHandler(Logger, LoggingHandler)}. Notice that
27-
* this could also be done through the {@code logging.properties} file.
27+
* this could also be done through the {@code logging.properties} file, adding the following line:
28+
* <pre>
29+
* {@code com.google.cloud.examples.logging.snippets.AddLoggingHandler.handlers=com.google.cloud.logging.LoggingHandler}
30+
* </pre>
2831
*/
2932
public class AddLoggingHandler {
3033

gcloud-java-logging/src/main/java/com/google/cloud/logging/AsyncLoggingHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@
7070
* </ul>
7171
*
7272
* <p>To add a {@code LoggingHandler} to an existing {@link Logger} and be sure to avoid infinite
73-
* recursion when logging, use the {@link #addHandler(Logger, LoggingHandler)} method.
73+
* recursion when logging, use the {@link #addHandler(Logger, LoggingHandler)} method. Alternatively
74+
* you can add the handler via {@code logging.properties}. For example using the following line:
75+
* <pre>
76+
* {@code com.example.mypackage.handlers=com.google.cloud.logging.AsyncLoggingHandler}
77+
* </pre>
7478
*/
7579
public class AsyncLoggingHandler extends LoggingHandler {
7680

gcloud-java-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@
8383
* </ul>
8484
*
8585
* <p>To add a {@code LoggingHandler} to an existing {@link Logger} and be sure to avoid infinite
86-
* recursion when logging, use the {@link #addHandler(Logger, LoggingHandler)} method.
86+
* recursion when logging, use the {@link #addHandler(Logger, LoggingHandler)} method. Alternatively
87+
* you can add the handler via {@code logging.properties}. For example using the following line:
88+
* <pre>
89+
* {@code com.example.mypackage.handlers=com.google.cloud.logging.LoggingHandler}
90+
* </pre>
8791
*/
8892
public class LoggingHandler extends Handler {
8993

0 commit comments

Comments
 (0)