Disable kundera logs in my custom logs

64 views
Skip to first unread message

Pavan Rao

unread,
Sep 14, 2015, 11:16:52 PM9/14/15
to kundera-discuss
Hi All,

I want to disable Kundera's log in my custom log file, essentially, I don't want to see Kundera's logs at all. The Kundera's PersistenceProperties interface doesn't have any Constant to disable logging.

I have my persistence xml like this.

    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="2.0">
    <persistence-unit name="rdb">
    <provider>com.impetus.kundera.KunderaPersistence</provider>
    <class>com.rakuten.points.persistence.entities.Geography</class>
<class>com.rakuten.points.persistence.entities.GrantPointSummary</class>
   <class>com.rakuten.points.persistence.entities.MemberPointSummary</class>
<class>com.rakuten.points.persistence.entities.PointDate</class>
<class>com.rakuten.points.persistence.entities.PointValue</class>
<class>com.rakuten.points.persistence.entities.Reason</class>
<class>com.rakuten.points.persistence.entities.Redemption</class>
<class>com.rakuten.points.persistence.entities.Service</class>
<class>com.rakuten.points.persistence.entities.Settlement</class>
<class>com.rakuten.points.persistence.entities.State</class>
        <properties>
<property name="kundera.nodes" value="localhost" />
<property name="kundera.port" value="9160" />
<property name="kundera.keyspace" value="LS" />
<property name="kundera.dialect" value="cassandra" />
<property name="kundera.show.query" value="false" />
<property name="kundera.client.lookup.class"
value="com.impetus.client.cassandra.thrift.ThriftClientFactory" />
<property name="kundera.ddl.auto.prepare" value="update" />
</properties>
</persistence-unit>
</persistence>

PersistenceProperties abstract interface looks like this, I am not able to find any constant that would disable logs for me, similar to other JPA providers(Example: https://wiki.eclipse.org/EclipseLink/Examples/JPA/Logging):

public abstract interface PersistenceProperties {
    public static final String KUNDERA_NODES = "kundera.nodes";
    public static final String KUNDERA_PORT = "kundera.port";
    public static final String KUNDERA_KEYSPACE = "kundera.keyspace";
    public static final String KUNDERA_DIALECT = "kundera.dialect";
    public static final String KUNDERA_CLIENT_FACTORY = "kundera.client.lookup.class";
    public static final String KUNDERA_CACHE_PROVIDER_CLASS = "kundera.cache.provider.class";
    public static final String KUNDERA_CACHE_CONFIG_RESOURCE = "kundera.cache.config.resource";
    public static final String KUNDERA_FETCH_MAX_DEPTH = "kundera.fetch.max.depth";
    public static final String KUNDERA_POOL_SIZE_MAX_ACTIVE = "kundera.pool.size.max.active";
    public static final String KUNDERA_POOL_SIZE_MAX_IDLE = "kundera.pool.size.max.idle";
    public static final String KUNDERA_POOL_SIZE_MIN_IDLE = "kundera.pool.size.min.idle";
    public static final String KUNDERA_POOL_SIZE_MAX_TOTAL = "kundera.pool.size.max.total";
    public static final String KUNDERA_INDEX_HOME_DIR = "index.home.dir";
    public static final String KUNDERA_DDL_AUTO_PREPARE = "kundera.ddl.auto.prepare";
    public static final String KUNDERA_SHOW_QUERY = "kundera.show.query";
    public static final String KUNDERA_CLIENT_PROPERTY = "kundera.client.property";
    public static final String KUNDERA_USERNAME = "kundera.username";
    public static final String KUNDERA_PASSWORD = "kundera.password";
    public static final String KUNDERA_BATCH_SIZE = "kundera.batch.size";
    public static final String KUNDERA_TRANSACTION_TIMEOUT = "kundera.transaction.timeout";
    public static final String KUNDERA_DATASTORE_FILE_PATH = "kundera.datastore.file.path";
    public static final String KUNDERA_TRANSACTION_RESOURCE = "kundera.transaction.resource.class";
    public static final String KUNDERA_INDEXER_CLASS = "kundera.indexer.class";
    public static final String KUNDERA_AUTO_GENERATOR_CLASS = "kundera.auto.generator.class";
}



My logback.xml is like this:

    <configuration>
    <property resource="resource.properties" />
    <appender name="FILE" class="ch.qos.logback.core.FileAppender">
    <file>${LOG_HOME}/RPoints.log</file>
    <encoder>
       <pattern>%date{HH:mm:ss.SSS} [%thread] %-5level %logger{15}#%line%msg%n</pattern>
     </encoder>
    </appender>
    <root level="debug">
    <appender-ref ref="FILE" />
    </root>
    </configuration>

I am getting the below logs in my custom log file, I want to avoid them in my custom log file. Please tell me how to do that:

    15:23:28.927 [http-apr-8080-exec-6] INFO  c.i.k.p.EntityManagerFactoryImpl#130 Loading Core
    15:23:28.930 [http-apr-8080-exec-6] INFO  c.i.k.l.CoreLoader#41 Loading Kundera Core Metdata ...
    15:23:28.933 [http-apr-8080-exec-6] INFO  c.i.k.p.EntityManagerFactoryImpl#654 Loading Persistence Unit MetaData For Persistence Unit(s) ruleengine.
    15:23:28.937 [http-apr-8080-exec-6] INFO  c.i.k.c.PersistenceUnitConfiguration#77 Loading Metadata from persistence.xml ...
    15:23:29.095 [http-apr-8080-exec-6] INFO  c.i.k.c.PersistenceUnitConfiguration#94 Finishing persistence unit metadata configuration ...
    15:23:29.104 [http-apr-8080-exec-6] DEBUG c.i.k.c.MetamodelConfiguration#98 Loading Entity Metadata...

Warm regards,
Pavan

Pavan Rao

unread,
Sep 15, 2015, 12:07:41 AM9/15/15
to kundera-discuss
Hi All,

<configuration>

<property resource="resource.properties" />
<logger name="<my classes>" level="DEBUG" />

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${LOG_HOME}/RPoints.log</file>
<encoder>
<pattern>%date{HH:mm:ss.SSS} [%thread] %-5level %logger{15}#%line
%msg%n</pattern>
</encoder>
</appender>

<root level="ERROR">
<appender-ref ref="FILE" />
</root>
</configuration>

I know this only gives log for my classes. But according to me, this is a workaround. I want to remove the logs from persistence.xml if possible. 

Warm regards,
Pavan
Reply all
Reply to author
Forward
0 new messages