ENABLE OrmLite Logging / Android / Java

52 Views Asked by At

I have taken over a project where the original developer used OrmLite as the DB library. I can not for the life of me figure out how to turn on SQL logging. I see a lot of posts asking how to turn it OFF but I'm not seeing any logging and I very much would like to. The project is using v6.1 of the library which I believe is the latest. Can someone help me turn on logging for my Java/Android project?

1

There are 1 best solutions below

4
Gray On

I can not for the life of me figure out how to turn on SQL logging.

Although I am the author of ORMLite, I'm not an Android programmer. There is a section in the manual about Android logging. Was it not helpful? I also found this page after a quick Google on enabling internal logging on Android. It wasn't helpful.

Happy to work with you to figure this out if you contact me via my contact page which is clickable off of the ORMLite homepage.

Edit:

Ah I see. You want to enable the logs programmatically I gather? The links that I posted give some queues on how to enable the logging:

LoggerFactory.setLogBackendFactory(LogBackendType.ANDROID);

The general ORMlite logging docs also talk about programmatic setting of levels, etc..

// filter out TRACE messages only
Logger.setGlobalLogLevel(Level.DEBUG);