Closed me73123 closed 3 years ago
Which LoggerFactory
is that? com.j256.ormlite.logger.LoggerFactory
? Then it depends on which Logger
you are using. My LocalLog
allows you to set the system property com.j256.ormlite.logger.level
to something like WARN
to turn off those logs. There is also the /ormliteLocalLog.properties
file which sets the levels per package. See the javadocs. With the property, you need to do this as soon as possible in your main or launching class. What is missing is a LocalLog.setGlobalLevel(...)
method. I'll add it.
If you are using another logging system (like log4j, slf4j, etc.) then you'll need to figure out how they are configured.
I tried the System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "ERROR")
or System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "error")
setting but it didn't work.Can you give me an example?
Also, if I want to use ormliteLocalLog.properties to set, where should the file be placed in the project?
In 5.2 I added a Logger.setGlobalLogLevel(...)
method which can be called early in your application to disable (or tune the level) of all logs. I also added an OFF
level to be able to turn off log messages.
I've just added a NullLog
log implementation as well that will be in 5.4. See: https://github.com/j256/ormlite-core/commit/e0103eed441ff4fe74b15805e4013896c2ba4853 Hope this is enough.
I get a lot of SQL logs with ormlite version 5.1. In the 4.4 version, there is no such log. But I will also use LoggerFactory.getLogger() in my project. How can I hide only the log of ormlite?
Logs like this: