[JAVA-3368] LoggingCommandEventSender should allow log length to be configurable Created: 31/Jul/19  Updated: 10/Oct/22  Resolved: 10/Oct/22

Status: Closed
Project: Java Driver
Component/s: Monitoring
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Maxime Carbonneau-Leclerc Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to JAVA-4485 Easier debugging with standardized lo... Scheduled

 Description   

LoggingCommandEventSender allows logging for commands. However, those commands can be truncated if the document is longer than 1000 characters. This value is hardcoded. It would be helpful to be able to configure it with the possibility to have a "no limit" value.

The limit comes from the commit https://github.com/mongodb/mongo-java-driver/commit/a93299f7a9a18e9febabfd8445a24af0f8a8c194 which was implemented for https://jira.mongodb.org/browse/JAVA-2698



 Comments   
Comment by Jeffrey Yemin [ 10/Oct/22 ]

This is a requirement of JAVA-4485, so closing as a duplicate.

Comment by Jeffrey Yemin [ 07/Aug/19 ]

Hi maxime.carbonneauleclerc@bell.ca

Thanks for the suggestion. Currently we don't have any direct configuration of logging (it's all done with external configuration of the logging provider) so we'd have to find a good way to do this. There might be other logger-related settings we'd want to group with this one, for example.

One workaround I can suggest: register your own CommandListener and do the logging yourself. The command events have all the information available that you would need to duplicate the driver's own logging.

Generated at Thu Feb 08 08:59:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.