0

I have changed configuration of mongodb driver to DEBUG, but it doesn’t help. I have tried other options of setting logs too, but it all seems not to work properly.

logging:
  level:
    root: info
    org.mongodb.driver.connection: debug

I am getting info logs like this constantly on INFO level:
[LOGGG] INFO [MaintenanceTimer-1-thread-1][AnonymousUser] [] org.mongodb.driver.connection: Opened connection [connectionId{localValue:12, serverValue:1403}] to localhost:27017

But with closing connection the logging level is fine:
2023-05-19 15:21:07,317 [LOGGG] DEBUG [SpringApplicationShutdownHook][AnonymousUser] [] org.mongodb.driver.connection: Closing connection connectionId{localValue:10, serverValue:1673}

I am using logback system for logging.

Can someone tell what is the valid way of changing log level of opening connection as for now?

1 Answers1

0

This worked for me; it removes the excessive logging that MongoDB prints: How to disable mongoDB java driver logging?