Mandiax / soi-toolkit

Automatically exported from code.google.com/p/soi-toolkit
0 stars 0 forks source link

Make event logging to JMS optional #385

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Background

---
The current eventlogger implementation: 
org.soitoolkit.commons.mule.log.DefaultEventLogger
always writes logs to JMS.
If eventlogs are read directly from logfiles instead of from JMS (think 
Logstash/ELK-stack for example) there is no point in logging to JMS.

Suggested solution

---
1. Make logging to JMS optional by adding a config flag to the 
DefaultEventLogger
2. Make the new flag optional and keep the default behaviour with logging to 
JMS, for backwards compatibility

Original issue reported on code.google.com by hakan.d...@gmail.com on 19 Mar 2015 at 9:58

GoogleCodeExporter commented 8 years ago
Fixed for 2.0.0-M5, commit: 02bf143

Example config for exposing the 
org.soitoolkit.commons.mule.log.DefaultEventLogger as a Spring bean while 
keeping defaults and allowing override config is in:

soi-toolkit-mule/commons/components/commons-mule/src/test/resources/logtest/test
-logging-to-jms-flow.xml

A somewhat smaller example for only turning off logging to JMS would be:

    <spring:beans>
        <!-- Ref: https://code.google.com/p/soi-toolkit/wiki/UG_CustomizeLogging -->
        <spring:bean name="soitoolkit.eventLogger" class="org.soitoolkit.commons.mule.log.DefaultEventLogger">
            <spring:property name="doLogToJms" value="${SOITOOLKIT_DO_LOG_TO_JMS:true}"/>
        </spring:bean>
    </spring:beans>

with the new property to configure in the property file for an integration 
component:

# turn logging to JMS on/off using config values: true/false
SOITOOLKIT_DO_LOG_TO_JMS=false

Original comment by hakan.d...@gmail.com on 19 Mar 2015 at 11:51