You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by vcheruvu <v_...@hotmail.com> on 2010/11/04 01:36:33 UTC

Camel-quickfix logging

Hi,

I am using Camel-quickfix 2.5. I have set my log4j setting to write to file.
Yet, i am seeing camel-quickfix  logging to my console as shown below. I am
trying to ensure below logging are written to file instead to my console. I
have pasted my log4j setting below as well. Could you please advise if I am 
missing something?

console output
<20101104-00:17:53, FIX.4.2:TEST->EXEC, event> (Session FIX.4.2:TEST->EXEC
schedule is daily, 11:25:00-UTC - 11:20:00-UTC)
<20101104-00:17:53, FIX.4.2:TEST->EXEC, event> (Created session:
FIX.4.2:TEST->EXEC)
<20101104-00:17:53, FIX.4.2:TEST->BROKER, event> (Session
FIX.4.2:TEST->BROKER schedule is daily, 11:25:00-UTC - 11:20:00-UTC)
<20101104-00:17:53, FIX.4.2:TEST->BROKER, event> (Created session:
FIX.4.2:TEST->BROKER)
<20101104-00:17:54, FIX.4.2:TEST->BROKER, event> (Initiated logon request)
<20101104-00:17:55, FIX.4.2:TEST->BROKER, event> (Received logon)



log4j.xml settings
.....

 <appender name="DAILY_FILE"
class="org.apache.log4j.DailyRollingFileAppender">
        
        
        
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
    </appender>

.....

 <logger name="org.apache.camel" additivity="false">
        <level value="INFO"/>
        <appender-ref ref="DAILY_FILE"/>
    </logger>

 <root>
        <level value="INFO"/>
        <appender-ref ref="DAILY_FILE"/>
 </root>


.....


Kind regards,
-Vid-

-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-quickfix-logging-tp3249378p3249378.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-quickfix logging

Posted by Christian Müller <ch...@gmail.com>.
Than maybe this page is helpful for you:
http://wiki.apache.org/logging-log4j/Log4jXmlFormat

Christian

Re: Camel-quickfix logging

Posted by vcheruvu <v_...@hotmail.com>.
Hmm log4j.properties file is weak compared to log4j.xml. The properties file
does not support some advanced configuration options like Filters, custom
ErrorHandlers and a special type of appenders, i.e. AsyncAppender.
ErrorHandlers defines how errors in log4j itself are handled, for example
badly configured appenders. Filters are more interesting. From the available
filters, I think that the level range filter is really missing for property
files.

The log4j filter allows to define that a[n] appender should receive log
messages from Level INFO to WARN. This allows to split log messages across
different logfiles. One for DEBUGGING messages, another for warnings, ...The
property appender only supports a minimum level. If you set it do INFO, you
will receive WARN, ERROR and FATAL messages as well.

Hence I wanted to use log4j.xml for advance feature purposes.

Cheers,
-Vid-
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-quickfix-logging-tp3249378p3251115.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-quickfix logging

Posted by Christian Müller <ch...@gmail.com>.
Hello Vid!

I think this is a question for the Log4J mailing list. They can answer this
question better than we...
However, if it's possible for you to use a property file for your log4j
configuration (that's the way Camel configure log4j), you will find many
samples in the Camel unit tests like this one:
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/resources/log4j.properties

Cheers,
Christian

Re: Camel-quickfix logging

Posted by Stephen Bate <ba...@technoetic.com>.
Vid and Claus,

QuickFIX/J currently loads the settings file by itself. The SessionSettings
class interface isn't a great fit for direct usage in an IoC framework but
we could investigate some type of adapter (e.g., a Spring factory bean) that
would allow it to be configured and injected into the component. I'm
assuming the ideal approach would support any IoC framework. I'd have to do
some experimentation to determine the feasibility of doing that.

The SessionSettings class does have its own simple property placeholder
capability. For example, a Properties object could be injected into the
quickfix component and that could be used to interpolate value placeholders
in the settings file.

For example, in the following settings file snippet the sender and target
will use substitutions from a supplied Properties object.

...
[SESSION]
BeginString=FIX.4.2
SenderCompID=${sender}
TargetCompID=${target}
...

Thoughts?

Steve

On 11/10/10 2:51 AM, "Claus Ibsen" <cl...@gmail.com> wrote:

> What if QuickFix allows IoC for its configuration. Then you have a
> much wider choice.
> I don't know if QuickFix mandates and loads the config file entirely by
> itself.
> 
> 
> 
> On Tue, Nov 9, 2010 at 11:31 PM, vcheruvu <v_...@hotmail.com> wrote:
>> 
>> Camel Riders,
>> 
>> Any thoughts to my second question on utilizing Camel property placeholder
>> for Quickfixj component's config files.I believe it will simplify config
>> file management and centralize all the environment specific values.
>> 
>> Kind regards,
>> -Vid-
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Camel-quickfix-logging-tp3249378p3257801.ht
>> ml
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> 
> 
> 



Re: Camel-quickfix logging

Posted by Claus Ibsen <cl...@gmail.com>.
What if QuickFix allows IoC for its configuration. Then you have a
much wider choice.
I don't know if QuickFix mandates and loads the config file entirely by itself.



On Tue, Nov 9, 2010 at 11:31 PM, vcheruvu <v_...@hotmail.com> wrote:
>
> Camel Riders,
>
> Any thoughts to my second question on utilizing Camel property placeholder
> for Quickfixj component's config files.I believe it will simplify config
> file management and centralize all the environment specific values.
>
> Kind regards,
> -Vid-
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-quickfix-logging-tp3249378p3257801.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel-quickfix logging

Posted by vcheruvu <v_...@hotmail.com>.
Camel Riders,

Any thoughts to my second question on utilizing Camel property placeholder
for Quickfixj component's config files.I believe it will simplify config
file management and centralize all the environment specific values. 

Kind regards,
-Vid-



-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-quickfix-logging-tp3249378p3257801.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-quickfix logging

Posted by Stephen Bate <ba...@technoetic.com>.
It's already committed to the trunk. The issue number is CAMEL-3318. To use
the updated component, just put SLF4J settings in your QFJ settings file and
the component will automatically create the SLF4JLogFactory. You'll also
need the slf4j-log4j12-*.jar bindings in your classpath if you're using
log4j as the logging framework.

Regards,

Steve

On 11/8/10 8:29 PM, "vcheruvu" <v_...@hotmail.com> wrote:

> 
> Thanks Steve. I look forward to your new patch. what is the issue link for
> this patch , so that i can have look at the changes that you will promote
> this weekend.



Re: Camel-quickfix logging

Posted by vcheruvu <v_...@hotmail.com>.
Thanks Steve. I look forward to your new patch. what is the issue link for
this patch , so that i can have look at the changes that you will promote
this weekend.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-quickfix-logging-tp3249378p3256092.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-quickfix logging

Posted by Stephen Bate <ba...@technoetic.com>.
Hello Vid,

Unfortunately, the SLFJ support in the QuickFIX/J component was somehow
forgotten. It currently supports the ScreenLog, FileLog and JdbcLog. I'll
submit a patch this weekend to provide support for the SLFJLog and for
custom log (and message store) implementations.

Regards,

Steve


On 11/3/10 8:36 PM, "vcheruvu" <v_...@hotmail.com> wrote:

> 
> Hi,
> 
> I am using Camel-quickfix 2.5. I have set my log4j setting to write to file.
> Yet, i am seeing camel-quickfix  logging to my console as shown below. I am
> trying to ensure below logging are written to file instead to my console. I
> have pasted my log4j setting below as well. Could you please advise if I am
> missing something?
> 
> console output
> <20101104-00:17:53, FIX.4.2:TEST->EXEC, event> (Session FIX.4.2:TEST->EXEC
> schedule is daily, 11:25:00-UTC - 11:20:00-UTC)
> <20101104-00:17:53, FIX.4.2:TEST->EXEC, event> (Created session:
> FIX.4.2:TEST->EXEC)
> <20101104-00:17:53, FIX.4.2:TEST->BROKER, event> (Session
> FIX.4.2:TEST->BROKER schedule is daily, 11:25:00-UTC - 11:20:00-UTC)
> <20101104-00:17:53, FIX.4.2:TEST->BROKER, event> (Created session:
> FIX.4.2:TEST->BROKER)
> <20101104-00:17:54, FIX.4.2:TEST->BROKER, event> (Initiated logon request)
> <20101104-00:17:55, FIX.4.2:TEST->BROKER, event> (Received logon)
> 
> 
> 
> log4j.xml settings
> .....
> 
>  <appender name="DAILY_FILE"
> class="org.apache.log4j.DailyRollingFileAppender">
>         
>         
>         
>         
>         <layout class="org.apache.log4j.PatternLayout">
>             
>         </layout>
>     </appender>
> 
> .....
> 
>  <logger name="org.apache.camel" additivity="false">
>         <level value="INFO"/>
>         <appender-ref ref="DAILY_FILE"/>
>     </logger>
> 
>  <root>
>         <level value="INFO"/>
>         <appender-ref ref="DAILY_FILE"/>
>  </root>
> 
> 
> .....
> 
> 
> Kind regards,
> -Vid-