[JAVA-932] How to disable driver logging Created: 21/Aug/13 Updated: 11/Sep/19 Resolved: 23/Jun/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Error Handling |
| Affects Version/s: | 2.11.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Alex Ryan | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The following code can be used to change the level at which events are logged by clients of the driver ... import java.util.logging.Logger; However, rather than have to write this code in many different places, I'd really like to have the ability to set the logging level in a single place. For example, the Amazon SDK, hc.apache and others allow me to do this in a log4j.properties file like so:
log4j.logger.org.apache.http=OFF Is there any way to do something like this with the mongoDB java driver? |
| Comments |
| Comment by Jeffrey Yemin [ 27/Mar/14 ] | |
|
In 3.0 the driver will log to SLF4J if it's present on the class path. SLF4J integrates better with log4j, and so I think will give you a better solution to this problem. As it is now, the driver uses JUL (java.util.logging), which has poor integration with log4j. Specifically, I don't think you can control the logging level for JUL via log4j properties | |
| Comment by Jeffrey Yemin [ 04/Dec/13 ] | |
|
Are you saying that this?
has no effect? If so, we can investigate. |