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
Copy file name to clipboardExpand all lines: modules/howtos/pages/collecting-information-and-logging.adoc
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ The Couchbase Java SDK logs events and also provides an event bus that transmits
11
11
12
12
== Logging
13
13
14
-
The Couchbase Java SDK uses https://www.slf4j.org[SLF4J], a logging facade that lets you use any logging framework that has an SLF4J binding.
14
+
The Couchbase Java SDK uses https://www.slf4j.org[SLF4J], a logging façade that lets you use any logging framework that has an SLF4J binding.
15
15
This includes popular Java logging frameworks like Log4j, Logback, and `java.util.logging` (JUL).
16
16
17
17
To see log messages from the Couchbase SDK, add an SLF4J binding as a dependency of your project.
@@ -195,7 +195,8 @@ Dedicated logging frameworks like Log4j 2 and Logback are more configurable, and
195
195
[NOTE]
196
196
.Event Bus Stability
197
197
====
198
-
While the event bus functionality itself is considered stable, the events itself may not be. Please only consume the events you are interested in, and add error handling code in case of unexpected behaviour.
198
+
While the event bus functionality itself is considered stable, the events themselves may not be.
199
+
Please only consume the events you are interested in, and add error handling code in case of unexpected behavior.
199
200
====
200
201
201
202
Log files are neither fun to wade through, nor do they have any kind of real-time aspect.
@@ -204,7 +205,8 @@ Since most setups interleave all different kinds of log messages, it makes it ve
204
205
205
206
To make the situation better and ultimately improve supportability, the Java SDK provides you with the ability to tap into all events before they get logged and consume them in "real-time".
206
207
207
-
You can subscribe to the event bus, and receive and react to events as they are happening; not when someone parses the logs, sends them into another system where an alarm is triggered, and eventually a sysadmin checks what iss going on.
208
+
You can subscribe to the event bus, and receive and react to events as they are happening;
209
+
not when someone parses the logs, sends them into another system where an alarm is triggered, and eventually a sysadmin checks what is going on.
208
210
The time delta between an event happening and reacting to it can thus be substantially decreased.
209
211
210
212
The following code subscribes to the event bus and prints out all events that are published on it with INFO or WARN level:
We recommend filtering on the specific events you are interested in, since most of the time only a subset of the published ones will be of use to you. Also, there are new events added between releases so make sure these new events do not break your functionality.
229
+
We recommend filtering on the specific events you are interested in, since most of the time only a subset of the published ones will be of use to you.
230
+
Also, there are new events added between releases so make sure these new events do not break your functionality.
228
231
229
232
[WARNING]
230
233
.Blocking Warning
231
234
====
232
-
If you consume the `EventBus` you MUST NOT block inside the consumer callback. It will stall all other consumers. If you must write into a blocking sink like a blocking HTTP API you MUST write it onto a different thread with a non-blocking queue first.
235
+
If you consume the `EventBus` you MUST NOT block inside the consumer callback. It will stall all other consumers.
236
+
If you must write into a blocking sink like a blocking HTTP API you MUST write it onto a different thread with a non-blocking queue first.
Different redaction levels are supported -- please see the `RedactionLevel` enum description for more information.
247
251
248
252
Note that you need to run this command before any of the SDK code is initialized so all of the logs are captured properly.
249
-
Once the SDK writes the logs with the tags to a file, you can then use the xref:7.1@server:cli:cbcli/cblogredaction.adoc[`cblogredaction` tool] to obfuscate the log.
253
+
Once the SDK writes the logs with the tags to a file, you can then use the xref:7.2@server:cli:cbcli/cblogredaction.adoc[`cblogredaction` tool] to obfuscate the log.
250
254
251
-
* You may wish to read more on Log Redaction xref:7.1@server:manage:manage-logging/manage-logging.adoc#understanding_redaction[in the Server docs].
255
+
* You may wish to read more on Log Redaction xref:7.2@server:manage:manage-logging/manage-logging.adoc#understanding_redaction[in the Server docs].
0 commit comments