I'm using QuickFIX/J version 2.1.1 and log4j2 on my project. Quickfix logs to path FileLogPath specified and the log file not rolling by daily. How can I configure the log file stored in daily with log4j2.xml configuration?
Asked
Active
Viewed 1,522 times
1 Answers
0
You currently cannot configure by way of QuickFIX/J configuration.
What you can do, is create your own logging strategy:
- Create a log factory class, extending
quickfix.LogFactory
- Create a log class, extending
quickfix.Log
- From the
quickfix.LogFactory.create( SessionID sessionID )
method, return a log class instance from the class you created in step 2. Take note of thequickfix.SessionSettings
instance for settings like log path and log heartbeats. - In your log class (see step 2), delegate to log4J functionality to have daily rolling
- Pass an instance of your log factory class (see step 1) when you create your
quickfix.Initiator
instance.
Logging should then be done using an instance of the logger class you created in step 2.
Note that QuickFIX/J is open source; you can always peek at implementations of quickfix.LogFactory
and quickfix.Log
to get some examples. For instance quickfix.FileLogFactory
and quickfix.FileLog
.

TT.
- 15,774
- 6
- 47
- 88