Combining Log4FIX and The QuickFIX/J FileLog
Here is a quick example showing how to use Log4FIX in live mode and the standard QuickFIX/J file log.
SessionSettings settings = ...
Log4FIX forLiveUpdate = Log4FIX.createForLiveUpdates(settings);
LogFactory log4FIXLogFactory = forLiveUpdate.getLogFactory();
LogFactory fileLogFactory = new FileLogFactory(settings);
// create a composite containing the Log4FIX LogFactory
// and the FileLogFactory
LogFactory compositeLogFactory = new CompositeLogFactory(new LogFactory[] {
log4FIXLogFactory, fileLogFactory});
initiator = new SocketInitiator(..., ..., ..., compositeLogFactory, ...);
...
// show the Log4FIX panel
forLiveUpdate.show();
Your QuickFIX/J application now sends log messages to Log4FIX and to a file.
Enjoy.
Add comment June 28th, 2007