[JAVA-375] Create logger per class/package Created: 09/Jun/11  Updated: 31/Mar/15  Resolved: 23/Aug/13

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

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: logging
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change

 Description   

For 3.0, we are going to standardize on new prefixes for all loggers:

  • org.mongodb.driver
  • org.bson

Logger names are:

  • org.mongodb.driver.management
  • org.mongodb.driver.cluster
  • org.mongodb.driver.cluster.monitor
  • org.mongodb.driver.connection
  • org.mongodb.driver.session
  • org.mongodb.driver.operation
  • org.mongodb.driver.protocol
  • org.mongodb.driver.uri
  • org.bson.reader
  • org.bson.writer
  • org.bson.ObjectId


 Comments   
Comment by Jeffrey Yemin [ 31/Mar/15 ]

Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released.

Comment by auto [ 23/Aug/13 ]

Author:

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

Message: JAVA-375: Standardizing on org.mongodb.driver as the prefix for all loggers. Loggers are currently:

Comment by Jeffrey Yemin [ 05/Apr/12 ]

I would consider this backward-breaking, since peoples existing log configuration would not work the same if we renamed the loggers.

Comment by shekhar vemuri [ 13/Dec/11 ]

the first pass IMO does not maandate changing actual behavior other than cleaning up initialization and proper package and class naming. so props init would still be thesame.

Comment by shekhar vemuri [ 13/Dec/11 ]

eg:
DBPort( ServerAddress addr , DBPortPool pool , MongoOptions options ){
_options = options;
_sa = addr;
_addr = addr.getSocketAddress();
_pool = pool;

_hashCode = _addr.hashCode();

_logger = Logger.getLogger( _rootLogger.getName() + "." + addr.toString() );
_decoder = _options.dbDecoderFactory.create();
}

this statement
_logger = Logger.getLogger( _rootLogger.getName() + "." + addr.toString() );
seems to have logic in creating a logger with the right name. is this something that can be changed(fixed) without causing other problems? the logging statements will probably also need to be fixed to reflect these changes and still output the right log info.

Comment by Scott Hernandez (Inactive) [ 13/Dec/11 ]

It would be nice if the old system properties still worked for a few versions.

Comment by shekhar vemuri [ 13/Dec/11 ]

i can take this up. should be straightforward enough to do as i attempt to familiarize myself with the code base for different changes anyways.

any gotchas you guys can think of in cleaning up the logger initialization and point to the standard classname format?

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