Skip to content

Commit d3ba990

Browse files
authored
chore: migrate README changes to .readme-partials.yaml (#121)
1 parent c4c8cc6 commit d3ba990

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

.readme-partials.yaml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,26 @@ custom_content: |
88
```xml
99
<configuration>
1010
<appender name="CLOUD" class="com.google.cloud.logging.logback.LoggingAppender">
11-
<!-- Optional : filter logs at or above a level -->
11+
<!-- Optional: filter logs at and above this level -->
1212
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
13-
<level>INFO</level>
13+
<level>INFO</level>
1414
</filter>
15-
<log>application.log</log> <!-- Optional : default java.log -->
16-
<!-- Optional : will use the default credentials of the environment if this property is not set -->
17-
<credentialsFile>/path/to/credentials.json</credentialsFile>
18-
<enhancer>com.example.enhancers.TestLoggingEnhancer</enhancer> <!-- Optional -->
19-
<enhancer>com.example.enhancers.AnotherEnhancer</enhancer> <!-- Optional -->
20-
<flushLevel>WARN</flushLevel> <!-- Optional : default ERROR -->
15+
16+
<!-- Optional: defaults to "java.log" -->
17+
<log>application.log</log>
18+
19+
<!-- Optional: defaults to "ERROR" -->
20+
<flushLevel>WARNING</flushLevel>
21+
22+
<!-- Optional: auto detects on App Engine Flex, Standard, GCE and GKE, defaults to "global". See supported resource types -->
23+
<resourceType></resourceType>
24+
25+
<!-- Optional: defaults to the default credentials of the environment -->
26+
<credentialsFile>/path/to/credentials/file</credentialsFile>
27+
28+
<!-- Optional: add custom labels to log entries using LoggingEnhancer classes -->
29+
<enhancer>com.example.enhancers.TestLoggingEnhancer</enhancer>
30+
<enhancer>com.example.enhancers.AnotherEnhancer</enhancer>
2131
</appender>
2232
2333
<root level="info">

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,28 @@ See [Logback filters](https://logback.qos.ch/manual/filters.html#thresholdFilter
7373
```xml
7474
<configuration>
7575
<appender name="CLOUD" class="com.google.cloud.logging.logback.LoggingAppender">
76-
<!-- Optional: filter logs at and above this level -->
76+
<!-- Optional: filter logs at and above this level -->
7777
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
7878
<level>INFO</level>
7979
</filter>
80-
80+
8181
<!-- Optional: defaults to "java.log" -->
8282
<log>application.log</log>
83-
83+
8484
<!-- Optional: defaults to "ERROR" -->
8585
<flushLevel>WARNING</flushLevel>
86-
86+
8787
<!-- Optional: auto detects on App Engine Flex, Standard, GCE and GKE, defaults to "global". See supported resource types -->
8888
<resourceType></resourceType>
89-
89+
9090
<!-- Optional: defaults to the default credentials of the environment -->
9191
<credentialsFile>/path/to/credentials/file</credentialsFile>
92-
92+
9393
<!-- Optional: add custom labels to log entries using LoggingEnhancer classes -->
9494
<enhancer>com.example.enhancers.TestLoggingEnhancer</enhancer>
9595
<enhancer>com.example.enhancers.AnotherEnhancer</enhancer>
9696
</appender>
97-
97+
9898
<root level="info">
9999
<appender-ref ref="CLOUD" />
100100
</root>
@@ -123,6 +123,17 @@ public class TestLogger {
123123

124124

125125

126+
## Samples
127+
128+
Samples are in the [`samples/`](https://github.com/googleapis/java-logging-logback/tree/master/samples) directory. The samples' `README.md`
129+
has instructions for running the samples.
130+
131+
| Sample | Source Code | Try it |
132+
| --------------------------- | --------------------------------- | ------ |
133+
| Quickstart | [source code](https://github.com/googleapis/java-logging-logback/blob/master/samples/snippets/src/main/java/com/example/logging/logback/Quickstart.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-logging-logback&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/logback/Quickstart.java) |
134+
| Example Enhancer | [source code](https://github.com/googleapis/java-logging-logback/blob/master/samples/snippets/src/main/java/com/example/logging/logback/enhancers/ExampleEnhancer.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-logging-logback&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/logback/enhancers/ExampleEnhancer.java) |
135+
136+
126137

127138
## Troubleshooting
128139

0 commit comments

Comments
 (0)