You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library allows you to use [Logback](https://logback.qos.ch/) configuration and the [Slf4j](https://www.slf4j.org/) interface to log via Google Cloud logging
7
+
This library allows you to use [Logback](https://logback.qos.ch/) configuration and the [Slf4j](https://www.slf4j.org/) interface to log via Google Cloud logging.
Add the appender to your [Logback configuration](https://logback.qos.ch/manual/configuration.html)`logback.xml`.
38
-
See [Logback filters](https://logback.qos.ch/manual/filters.html#thresholdFilter) on filtering log output and
39
-
[encoders](https://logback.qos.ch/manual/encoders.html) on formatting.
38
+
See [Logback filters](https://logback.qos.ch/manual/filters.html#thresholdFilter)for information on filtering log output and
39
+
[encoders](https://logback.qos.ch/manual/encoders.html)for information on formatting.
Open issues [here](https://github.com/GoogleCloudPlatform/google-cloud-java/issues?q=is%3Aissue+is%3Aopen+label%3A%22logging-logback%22).
Copy file name to clipboardExpand all lines: google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java
+64-49Lines changed: 64 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -31,24 +31,30 @@
31
31
32
32
importjava.util.ArrayList;
33
33
importjava.util.Collections;
34
+
importjava.util.HashSet;
34
35
importjava.util.List;
36
+
importjava.util.Set;
35
37
36
38
/**
37
39
* <a href="https://logback.qos.ch/">Logback</a> appender for StackDriver Cloud Logging.
* <li><log>application.log</log> (Optional, defaults to "java.log" : Stackdriver log name)</li>
43
-
* <li><level>ERROR</level> (Optional, defaults to "INFO" : logs at or above this level)</li>
44
-
* <li><flushLevel>WARNING</flushLevel> (Optional, defaults to "ERROR")</li>
45
-
* <li><resourceType></resourceType> (Optional, auto detects on App Engine Flex, Standard, GCE and
46
-
* GKE, defaults to "global".
47
-
* See <a href="https://cloud.google.com/logging/docs/api/v2/resource-list">supported resource
* Batched logging requests get immediately flushed for logs at or above level.
75
+
* Batched logging requests get immediately flushed for logs at or above this level.
70
76
*
71
77
* <p>Defaults to Error if not set.
72
78
*
@@ -77,7 +83,7 @@ public void setFlushLevel(Level flushLevel) {
77
83
}
78
84
79
85
/**
80
-
* Sets the log filename, defaults to java.log.
86
+
* Sets the log filename.
81
87
*
82
88
* @param log filename
83
89
*/
@@ -89,21 +95,21 @@ public void setLog(String log) {
89
95
* Sets the name of the monitored resource (Optional).
90
96
*
91
97
* <p>Must be a <a href="https://cloud.google.com/logging/docs/api/v2/resource-list">supported</a>
92
-
* resource type. gae_app, gce_instance and container are auto-detected, defaults to "global"
98
+
* resource type. gae_app, gce_instance and container are auto-detected.
99
+
*
100
+
* <p>Defaults to "global"
93
101
*
94
-
* @param resourceType name of monitored resource
102
+
* @param resourceType name of the monitored resource
95
103
*/
96
104
publicvoidsetResourceType(StringresourceType) {
97
105
this.resourceType = resourceType;
98
106
}
99
107
100
108
/**
101
109
* Add extra labels using classes that implement {@link LoggingEnhancer}.
102
-
*
103
-
* @param enhancers list of enhancer classnames (comma separated)
Copy file name to clipboardExpand all lines: google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/AnotherTestLoggingEnhancer.java
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@
13
13
* See the License for the specific language governing permissions and
0 commit comments