0

This should be so simple to accomplish that not being able to do so is driving me crazy!

I'm using ActiveJDBC (which uses slf4j) along logback, and it seems it is IMPOSSIBLE to adjust the log level on ActiveJDBC so it doesn't print a NOTICE to console every time a new connection is opened.

There is no mention about adjusting log level on ActiveJDBC documentation: http://javalite.io/logging

I have tried this way:

import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;

Logger root = (Logger) LoggerFactory.getLogger("org.javalite.activejdbc.DB");
root.setLevel(Level.DEBUG);

With no luck, setting the output filter does not work either:

org.javalite.activejdbc.LogFilter.setLogExpression("WARNING");

Has somebody been able to adjust the log level so it does not clutter the output from console?

ipolevoy
  • 5,432
  • 2
  • 31
  • 46
Ox3
  • 451
  • 1
  • 6
  • 22

1 Answers1

0

I suggest you switch to a snapshot version 2-SNAPSHOT sourced from this repository: http://repo.javalite.io/.

All you have to do is to add this to your pom.xm:

<repository>
    <id>snapshots1</id>
    <name>JavaLite Snapshots1</name>
    <url>http://repo.javalite.io/</url>
    <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
        <checksumPolicy>warn</checksumPolicy>
    </snapshots>
</repository>

This version prints connection open events at the DEBUG level already

https://github.com/javalite/activejdbc/blob/21abad2295ee76daa7e0ef536ea62419cbd89423/activejdbc/src/main/java/org/javalite/activejdbc/DB.java#L130-L130

Additionally, if you want to have a 100% control over ActiveJDBC logging, you can implement a custom logger: http://javalite.io/logging#custom-logger

ipolevoy
  • 5,432
  • 2
  • 31
  • 46