-
Type: Investigation
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Not Needed
As a result of changes introduced here, logging messages produced by servers with the embeddedRouter feature flag set will contain a new top-level attribute between the "ctx" and "msg" fields named "svc". As such, any log ingestion that is sensitive to the format of log messages may need to be updated to account for the presence of this field.
Example of the same (truncated) log line before and after this change:
```
[js_test:config_settings_schema] s20043| {"t":
,"s":"I", "c":"COMMAND", "id":51803, "ctx":"ClusterServerParameterRefresher","msg":"Slow query","attr" ...
[js_test:config_settings_schema] s20043| {"t":
,"s":"I", "c":"COMMAND", "id":51803, "svc":"r", "ctx":"ClusterServerParameterRefresher","msg":"Slow query","attr":
```
Description of Linked Ticket
By embedding the router service into the MongoD binary, the process will combine logging information for both router and shard roles in the same file, i.e., mongod.log.
To discriminate log traces produced by routers and shards with the same content (e.g., Slow query), a new attribute should be added to the log traces to specify the role that produced it. For example:
{"t":{"$date":"2023-08-08T08:56:43.638+00:00"},"s":"I","c":"COMMAND", "id":51803,"service":"router","ctx":"conn6","msg":"Slow query","attr":{...}}
- depends on
-
SERVER-80676 (SA) Extend the logging system to tag logs with their corresponding service name
- Closed