@@ -528,31 +528,22 @@ export function parseOptions(
528528 ) ;
529529 }
530530
531- mongoOptions . __enableMongoLogger = mongoOptions . __enableMongoLogger ?? false ;
532-
533- let loggerEnvOptions : MongoLoggerEnvOptions = { } ;
534- let loggerClientOptions : MongoLoggerMongoClientOptions = { } ;
535- if ( mongoOptions . __enableMongoLogger ) {
536- loggerEnvOptions = {
531+ mongoOptions . mongoLoggerOptions = MongoLogger . resolveOptions (
532+ {
537533 MONGODB_LOG_COMMAND : process . env . MONGODB_LOG_COMMAND ,
538534 MONGODB_LOG_TOPOLOGY : process . env . MONGODB_LOG_TOPOLOGY ,
539535 MONGODB_LOG_SERVER_SELECTION : process . env . MONGODB_LOG_SERVER_SELECTION ,
540536 MONGODB_LOG_CONNECTION : process . env . MONGODB_LOG_CONNECTION ,
541537 MONGODB_LOG_CLIENT : process . env . MONGODB_LOG_CLIENT ,
542538 MONGODB_LOG_ALL : process . env . MONGODB_LOG_ALL ,
543539 MONGODB_LOG_MAX_DOCUMENT_LENGTH : process . env . MONGODB_LOG_MAX_DOCUMENT_LENGTH ,
544- MONGODB_LOG_PATH : process . env . MONGODB_LOG_PATH ,
545- ...mongoOptions . __internalLoggerConfig
546- } ;
547- loggerClientOptions = {
540+ MONGODB_LOG_PATH : process . env . MONGODB_LOG_PATH
541+ } ,
542+ {
548543 mongodbLogPath : mongoOptions . mongodbLogPath ,
549544 mongodbLogComponentSeverities : mongoOptions . mongodbLogComponentSeverities ,
550545 mongodbLogMaxDocumentLength : mongoOptions . mongodbLogMaxDocumentLength
551- } ;
552- }
553- mongoOptions . mongoLoggerOptions = MongoLogger . resolveOptions (
554- loggerEnvOptions ,
555- loggerClientOptions
546+ }
556547 ) ;
557548
558549 mongoOptions . metadata = makeClientMetadata ( mongoOptions ) ;
@@ -1232,52 +1223,6 @@ export const OPTIONS = {
12321223 default : 0 ,
12331224 type : 'int'
12341225 } ,
1235- // Custom types for modifying core behavior
1236- connectionType : { type : 'any' } ,
1237- srvPoller : { type : 'any' } ,
1238- // Accepted Node.js Options
1239- allowPartialTrustChain : { type : 'any' } ,
1240- minDHSize : { type : 'any' } ,
1241- pskCallback : { type : 'any' } ,
1242- secureContext : { type : 'any' } ,
1243- enableTrace : { type : 'any' } ,
1244- requestCert : { type : 'any' } ,
1245- rejectUnauthorized : { type : 'any' } ,
1246- checkServerIdentity : { type : 'any' } ,
1247- ALPNProtocols : { type : 'any' } ,
1248- SNICallback : { type : 'any' } ,
1249- session : { type : 'any' } ,
1250- requestOCSP : { type : 'any' } ,
1251- localAddress : { type : 'any' } ,
1252- localPort : { type : 'any' } ,
1253- hints : { type : 'any' } ,
1254- lookup : { type : 'any' } ,
1255- ca : { type : 'any' } ,
1256- cert : { type : 'any' } ,
1257- ciphers : { type : 'any' } ,
1258- crl : { type : 'any' } ,
1259- ecdhCurve : { type : 'any' } ,
1260- key : { type : 'any' } ,
1261- passphrase : { type : 'any' } ,
1262- pfx : { type : 'any' } ,
1263- secureProtocol : { type : 'any' } ,
1264- index : { type : 'any' } ,
1265- // Legacy options from v3 era
1266- useNewUrlParser : {
1267- type : 'boolean' ,
1268- deprecated :
1269- 'useNewUrlParser has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version'
1270- } as OptionDescriptor ,
1271- useUnifiedTopology : {
1272- type : 'boolean' ,
1273- deprecated :
1274- 'useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version'
1275- } as OptionDescriptor ,
1276- // MongoLogger
1277- /**
1278- * @internal
1279- * TODO: NODE-5671 - remove internal flag
1280- */
12811226 mongodbLogPath : {
12821227 transform ( { values : [ value ] } ) {
12831228 if (
@@ -1296,10 +1241,6 @@ export const OPTIONS = {
12961241 return value ;
12971242 }
12981243 } ,
1299- /**
1300- * @internal
1301- * TODO: NODE-5671 - remove internal flag
1302- */
13031244 mongodbLogComponentSeverities : {
13041245 transform ( { values : [ value ] } ) {
13051246 if ( typeof value !== 'object' || ! value ) {
@@ -1325,14 +1266,49 @@ export const OPTIONS = {
13251266 return value ;
13261267 }
13271268 } ,
1328- /**
1329- * @internal
1330- * TODO: NODE-5671 - remove internal flag
1331- */
13321269 mongodbLogMaxDocumentLength : { type : 'uint' } ,
1333- __enableMongoLogger : { type : 'boolean' } ,
1334- __skipPingOnConnect : { type : 'boolean' } ,
1335- __internalLoggerConfig : { type : 'record' }
1270+ // Custom types for modifying core behavior
1271+ connectionType : { type : 'any' } ,
1272+ srvPoller : { type : 'any' } ,
1273+ // Accepted Node.js Options
1274+ allowPartialTrustChain : { type : 'any' } ,
1275+ minDHSize : { type : 'any' } ,
1276+ pskCallback : { type : 'any' } ,
1277+ secureContext : { type : 'any' } ,
1278+ enableTrace : { type : 'any' } ,
1279+ requestCert : { type : 'any' } ,
1280+ rejectUnauthorized : { type : 'any' } ,
1281+ checkServerIdentity : { type : 'any' } ,
1282+ ALPNProtocols : { type : 'any' } ,
1283+ SNICallback : { type : 'any' } ,
1284+ session : { type : 'any' } ,
1285+ requestOCSP : { type : 'any' } ,
1286+ localAddress : { type : 'any' } ,
1287+ localPort : { type : 'any' } ,
1288+ hints : { type : 'any' } ,
1289+ lookup : { type : 'any' } ,
1290+ ca : { type : 'any' } ,
1291+ cert : { type : 'any' } ,
1292+ ciphers : { type : 'any' } ,
1293+ crl : { type : 'any' } ,
1294+ ecdhCurve : { type : 'any' } ,
1295+ key : { type : 'any' } ,
1296+ passphrase : { type : 'any' } ,
1297+ pfx : { type : 'any' } ,
1298+ secureProtocol : { type : 'any' } ,
1299+ index : { type : 'any' } ,
1300+ // Legacy options from v3 era
1301+ useNewUrlParser : {
1302+ type : 'boolean' ,
1303+ deprecated :
1304+ 'useNewUrlParser has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version'
1305+ } as OptionDescriptor ,
1306+ useUnifiedTopology : {
1307+ type : 'boolean' ,
1308+ deprecated :
1309+ 'useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version'
1310+ } as OptionDescriptor ,
1311+ __skipPingOnConnect : { type : 'boolean' }
13361312} as Record < keyof MongoClientOptions , OptionDescriptor > ;
13371313
13381314export const DEFAULT_OPTIONS = new CaseInsensitiveMap (
0 commit comments