...
Here you go, all exchanges will be logged into the data/audit/file
directory.
Note that the file auditor is quite limited and only support counting the number of exchanges, but the exchanges are written in plain text so you can view those easily.
JDBC auditor
First install the audit feature:
...
Code Block | ||
---|---|---|
| ||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"> <manifest> DynamicImport-Package = * </manifest> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" /> <bean id="jdbc-auditor" class="org.apache.servicemix.nmr.audit.jdbc.JdbcAuditor"> <property name="dataSource" ref="dataSource" /> </bean> <bean id="dataSource" class="org.hsqldb.jdbc.jdbcDataSource"> <property name="database" value="jdbc:hsqldb:file:${servicemix.base}/data/audit/jdbc/hsqldb" /> <property name="user" value="sa" /> </bean> <osgi:service ref="jdbc-auditor"> <osgi:interfaces> <value>org.apache.servicemix.nmr.api.event.Listener</value> <value>org.apache.servicemix.nmr.api.event.ExchangeListener</value> </osgi:interfaces> </osgi:service> <osgi:service ref="filejdbc-auditor"> <osgi:interfaces> <value>org.apache.servicemix.nmr.audit.AuditorMBean</value> </osgi:interfaces> </osgi:service> </beans> |
...
Code Block | ||
---|---|---|
| ||
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<manifest>
DynamicImport-Package = *
</manifest>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
<bean id="jdbc-auditor" class="org.apache.servicemix.nmr.audit.jdbc.JdbcAuditor">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="lucene-auditor" class="org.apache.servicemix.nmr.audit.lucene.LuceneAuditor">
<property name="delegatedAuditor" ref="jdbc-auditor" />
<property name="luceneIndexer">
<bean class="org.apache.servicemix.nmr.audit.lucene.LuceneIndexer">
<property name="directoryName" value="${servicemix.base}/data/audit/lucene/" />
</bean>
</property>
</bean>
<bean id="dataSource" class="org.hsqldb.jdbc.jdbcDataSource">
<property name="database" value="jdbc:hsqldb:file:${servicemix.base}/data/audit/jdbc/hsqldb" />
<property name="user" value="sa" />
</bean>
<osgi:service ref="lucene-auditor">
<osgi:interfaces>
<value>org.apache.servicemix.nmr.api.event.Listener</value>
<value>org.apache.servicemix.nmr.api.event.ExchangeListener</value>
</osgi:interfaces>
</osgi:service>
<osgi:service ref="lucene-auditor">
<osgi:interfaces>
<value>org.apache.servicemix.nmr.audit.AuditorMBean</value>
</osgi:interfaces>
</osgi:service>
</beans>
|
...