How can I change MongoDB Sync Driver Logging level to SEVERE using PaperMC?

18 Views Asked by At

I am using: MongoDB Sync Driver 5.0.0 Paper 1.20.4

I've tried several solutions found online, but none seem to be working for me. Among the most promising attempts, I've experimented with using a logback.xml file (placed in the resources folder), a log4j2.xml file (similarly located), and utilizing Logger from Java's Logger Util.

I came across a post (https://stackoverflow.com/a/66800835/22169727) suggesting that MongoDB actually employs SLF4J in newer versions, which might be the source of the issue.

What do you suggest I do next?

(I am trying to hide, above all, MongoDB initial's connection spam)

@Override
public void onLoad() {

    Logger logger = Logger.getLogger("org.mongodb.driver");
    logger.setLevel(Level.SEVERE);
    
}
0

There are 0 best solutions below