@@ -12,7 +12,7 @@ Logging
1212
1313Abstract
1414========
15- This specification defines requirements for drivers' logging configuration and behavior.
15+ This specification defines requirements for drivers' logging configuration and behavior.
1616
1717
1818META
@@ -51,7 +51,7 @@ not require any changes to an application's source code, and in the case of comp
5151does not require recompilation.
5252However, if that is impossible to do without conflicting with idiomatic logging patterns for the
5353language ecosystem, it is acceptable for a driver to require minimal changes to enable logging,
54- such as recompiling with a feature flag specified, or passing a logging configuration to a
54+ such as recompiling with a feature flag specified, or passing a logging configuration to a
5555``MongoClient `` constructor. In that case, drivers SHOULD strive to minimize the amount of code
5656change needed.
5757
@@ -75,8 +75,8 @@ Per-Component Configuration of Log Levels
7575-----------------------------------------
7676Drivers MUST support enabling logging and specifying the minimum severity level for emitted messages
7777on a per-component level, for each component defined below in the `Components `_ section.
78-
79- **Fallback implementation method **: Support configuration via environment variables
78+
79+ **Fallback implementation method **: Support configuration via environment variables
8080 corresponding to each component, as defined in `Components `_, as well as via the
8181 environment variable ``MONGODB_LOG_ALL ``.
8282
@@ -89,7 +89,7 @@ on a per-component level, for each component defined below in the `Components`_
8989 If ``MONGODB_LOG_ALL `` is specified in addition to one or more component variables, the
9090 component variable(s) MUST take precedence.
9191
92- The default is to not log anything.
92+ The default is to not log anything.
9393
9494 If a variable is set to an invalid value, it MUST be treated as if it were not specified at all.
9595
@@ -118,11 +118,11 @@ producing invalid Unicode data.
118118Drivers MUST implement truncation naively by simply truncating the output at the required length; i.e.
119119do not attempt to implement truncation such that the output is still valid JSON.
120120Truncated extended JSON MUST have a trailing ellipsis ``... `` appended to indicate to the user that
121- truncation occurred. The ellipsis MUST NOT count toward the the max length.
121+ truncation occurred. The ellipsis MUST NOT count toward the max length.
122122
123123 **Fallback Implementation method **: Environment variable ``MONGOB_LOG_MAX_DOCUMENT_LENGTH ``.
124124 When unspecified, any extended JSON representation of a document which is longer than the
125- default max length MUST be truncated to that length.
125+ default max length MUST be truncated to that length.
126126 When set to an integer value, any extended JSON document longer than that value MUST be
127127 truncated to that length.
128128 If the variable is set to an invalid value, it MUST be treated as if it were not specified at
@@ -149,7 +149,7 @@ driver-specific messages they produce.
149149 - Environment Variable
150150
151151 * - command
152- - `Command Monitoring <../command-monitoring/command-monitoring.rst >`__
152+ - `Command Logging and Monitoring <../command-logging-and- monitoring/command-logging-and -monitoring.rst >`__
153153 - ``MONGODB_LOG_COMMAND ``
154154
155155 * - topology
@@ -263,7 +263,7 @@ SHOULD utilize it to support both types of logging.
263263
264264Note that drivers implementing unstructured logging MUST still support some internal way to intercept
265265the data contained in messages in a structured form, as this is required to implement the unified tests
266- for logging conformance.. See the `unified test format specification
266+ for logging conformance. See the `unified test format specification
267267<../unified-test-format/unified-test-format.rst#expectedLogMessage> `_ for details.
268268
269269Representing Documents in Log Messages
@@ -277,7 +277,7 @@ Drivers MAY represent errors in log messages in whatever format is idiomatic for
277277existing error types. For example, if a driver's error classes have existing ``toString() ``
278278implementations, those MAY be used. Alternatively, if a driver emits structured log messages, a
279279structured format containing error data could be used. Any information which a driver reports via
280- its error classes MUST be included in the log representations.
280+ its error classes MUST be included in the log representations.
281281Note that if the driver includes full server responses in its errors these MUST be truncated in
282282accordance with the max document length option.
283283
@@ -286,7 +286,7 @@ Omitting Null Values from Log Messages
286286Some log messages will include fields that are only present under particular circumstances, for example
287287on certain server versions. When such a field is not present:
288288
289- - If the driver does structured logging, the field MUST be omitted from the message altogether, i.e. the field
289+ - If the driver does structured logging, the field MUST be omitted from the message altogether, i.e. the field
290290 MUST not be present with an explicit null value.
291291- If the driver does unstructured logging, the corresponding segment of the message string MUST be omitted
292292 altogether.
@@ -296,8 +296,8 @@ Performance Considerations
296296The computation required to generate certain log messages can be significant, e.g. if extended
297297JSON serialization is required. If possible, drivers SHOULD check whether a log message would
298298actually be emitted and consumed based on the users' configuration before doing such computation.
299- For example, this can be checked in Rust via `log::log_enabled
300- <https://docs.rs/log/latest/log/macro.log_enabled.html> `_.
299+ For example, this can be checked in Rust via `log::log_enabled
300+ <https://docs.rs/log/latest/log/macro.log_enabled.html> `_.
301301
302302Drivers SHOULD optimize extended JSON generation to avoid generating JSON strings longer than will
303303be emitted, such that the complexity is O(N) where N = ``<max document length> ``, rather than
@@ -344,7 +344,7 @@ Design Rationale
344344Truncation of large documents
345345-----------------------------
346346
347- 1. Why have an option?
347+ 1. Why have an option?
348348 We considered a number of approaches for dealing with documents of potentially very large size
349349 in log messages, e.g. command documents, including 1) always logging the full document, 2) only
350350 logging documents with the potential to be large when the user opts in, and 3) truncating large
@@ -354,10 +354,10 @@ Truncation of large documents
354354 will show the user the full data. In the case where data is large, the user will receive a
355355 readable message with truncated data, but have the option to see more or all of the data.
356356
357- 2. Why are the units for max document length flexible?
357+ 2. Why are the units for max document length flexible?
358358 String APIs vary across languages, and not all drivers will be able to easily and efficiently
359359 truncate strings in the same exact manner. The important thing is that the option exists and
360- that its default value is reasonable, and for all possible unit choices (byte, code point,
360+ that its default value is reasonable, and for all possible unit choices (byte, code point,
361361 code unit, or grapheme) we felt 1000 was a reasonable default. See
362362 `here <https://exploringjs.com/impatient-js/ch_unicode.html >`_ for a helpful primer on related
363363 Unicode concepts.
0 commit comments