[JAVA-2851] Decrease logging spam for ObjectId when JMX is unavailable Created: 03/May/18  Updated: 28/Oct/23  Resolved: 21/May/18

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

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently the ObjectId class logs a warning with a stack trace when it's unable to get a process id from JMX.  The driver should log this at DEBUG and not include the stack trace.  This will help reduce log spam in environments where JMX is unavailable, e.g. Android.



 Comments   
Comment by Jeffrey Yemin [ 21/May/18 ]

Note: wrong issue mentioned in the commit.

Comment by Jeffrey Yemin [ 21/May/18 ]

Author:

{'username': 'jyemin', 'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com'}

Message: JAVA-2852: Log failure to get machine or process id at debug

The ObjectId class logs its failure to get either the machine identifer,
from NetworkInterface#getNetworkInterfaces, or the process
identifier, from JMX, at warning level, and includes the stack trace.

This is annoying for applications running on platforms where this occurs
(e.g. IBM JRE or Android's Dalvik), as it appears in the logs on every
application startup, there's no workaround, and the fallback behavior of
using SecureRandom is not a cause for concern.

This commit removes the stack trace from the log message and changes the
level from warn to debug
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/a55d172161511132d1be5c6100443065b9444ef2

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