[teiid-issues] [JBoss JIRA] (TEIID-3524) Database Logging not working

Jan Stastny (JIRA) issues at jboss.org
Tue Jun 16 04:46:04 EDT 2015


    [ https://issues.jboss.org/browse/TEIID-3524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13079528#comment-13079528 ] 

Jan Stastny commented on TEIID-3524:
------------------------------------

I tried to log more logs than is the batch-size value (I ran a query ten times, which should produce 40 log entries, batch-size is 25 by default), but still nothing gets into the logging database.

To provide logs I have altered persistence.xml in database-service.jar as follows (the only edited property is hibernate.show_sql):
{code:xml}
<persistence version="2.0"
   xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
        http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
   <persistence-unit name="teiid-logger">
      <jta-data-source>java:/teiid-log-ds</jta-data-source>
      <properties>
         <!-- Properties for Hibernate -->
                <property name="hibernate.hbm2ddl.auto" value="update" />
                <property name="hibernate.show_sql" value="true" />
                <property name="hibernate.jdbc.batch_size" value="25"/>
      </properties>
   </persistence-unit>
</persistence>
{code}
Then I set org.hibernate.SQL logger to DEBUG level and examined the server.log for corresponding log entries. There are no entries suggesting, that anything gets through Hibernate. Compared to older versions, there are NO logs as:
{code:plain}
13:30:19,548 DEBUG [org.hibernate.SQL] (pool-1-thread-1) select next_val as id_val from hibernate_sequence for update
13:30:19,706 DEBUG [org.hibernate.SQL] (pool-1-thread-1) update hibernate_sequence set next_val= ? where next_val=?
13:30:20,018 DEBUG [org.hibernate.SQL] (pool-1-thread-1) insert into commandlog (applicationname, executionid, modelname, principal, queryplan, requestid, row_count, sessionid, sourcecommand, sourcerequestid, sqlcmd, eventtype, logtime, transactionid, translatorname, vdbname, vdbversion, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
{code}
But there are present org.teiid.COMMAND_LOG entries in server.log:
{code:plain}
08:27:49,547 DEBUG [org.teiid.COMMAND_LOG] (Worker1_QueryProcessorQueue1)       START DATA SRC COMMAND: startTime=2015-06-16 08:27:49.547       requestID=YQFPgFN1w2US.0        sourceCommandID=0       executionID=0   txID=null       modelName=Accounts      translatorName=translator-h2    sessionID=YQFPgFN1w2US  principal=user at teiid-security   sql=SELECT g_0.ID, g_0.SYMBOL, g_0.COMPANY_NAME FROM Accounts.PRODUCT AS g_0
08:27:49,552 DEBUG [org.teiid.COMMAND_LOG] (Worker0_QueryProcessorQueue2)       END SRC COMMAND:        endTime=2015-06-16 08:27:49.552 requestID=YQFPgFN1w2US.0        sourceCommandID=0       executionID=0   txID=null       modelName=Accounts      translatorName=translator-h2    sessionID=YQFPgFN1w2US  principal=user at teiid-security   finalRowCount=25
08:27:49,598 DEBUG [org.teiid.COMMAND_LOG] (Worker0_QueryProcessorQueue3)       END USER COMMAND:       endTime=2015-06-16 08:27:49.598 requestID=YQFPgFN1w2US.0        txID=null       sessionID=YQFPgFN1w2US  principal=user at teiid-security   vdbName=Portfolio       vdbVersion=1    finalRowCount=25
08:27:49,598 DEBUG [org.teiid.COMMAND_LOG] (New I/O worker #75)         START USER COMMAND:     startTime=2015-06-16 08:27:49.598       requestID=YQFPgFN1w2US.1        txID=null       sessionID=YQFPgFN1w2US  applicationName=JDBC    principal=user at teiid-security   vdbName=Portfolio       vdbVersion=1    sql=select * from product
{code}

> Database Logging not working
> ----------------------------
>
>                 Key: TEIID-3524
>                 URL: https://issues.jboss.org/browse/TEIID-3524
>             Project: Teiid
>          Issue Type: Bug
>    Affects Versions: 8.7.1.6_2
>            Reporter: Jan Stastny
>            Assignee: Van Halbert
>
> When using db logging in Teiid, nothing gets inserted into the db. Logs appear at server.log, but not in the db.
> I set up the logging as follows:
> Created java:/teiid-log-ds datasource.
> Added these to logging subsystem:
> {code:xml}
> <async-handler name="TEIID_COMMAND_LOG">
>     <level name="DEBUG"/>
>     <queue-length value="50"/>
>     <overflow-action value="block"/>
>     <subhandlers>
>         <handler name="TEIID_JPA_LOG"/>
>     </subhandlers>
> </async-handler>
> <async-handler name="TEIID_AUDIT_LOG">
>     <level name="DEBUG"/>
>     <queue-length value="50"/>
>     <overflow-action value="block"/>
>     <subhandlers>
>         <handler name="TEIID_JPA_LOG"/>
>     </subhandlers>
> </async-handler>
> <custom-handler name="TEIID_JPA_LOG" class="org.teiid.logger.DatabaseAppender" module="org.jboss.teiid.extensions">
>    <level name="DEBUG"/>
> </custom-handler>
> <logger category="org.teiid.COMMAND_LOG">
>    <level name="DEBUG"/>
>       <handlers>
>           <handler name="TEIID_COMMAND_LOG"/>
>       </handlers>
> </logger>
> <logger category="org.teiid.AUDIT_LOG">
>   <level name="DEBUG"/>
>   <handlers>
>     <handler name="TEIID_AUDIT_LOG"/>
>   </handlers>
> </logger>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the teiid-issues mailing list