|
From: Robert N. <rob...@gm...> - 2022-04-18 11:55:52
|
With log4j 1.x you could have initial appenders configured in your log4j config and you could add new appenders and loggers in code based on the quickfix sessions you had defined at runtime and it kept a lot of static content out of your log config. This means that you still have effective logging active prior to initializing your FIX connections which is where all the dynamic logger creation is done. With log4j 2.x it seems you’re expected to either define it all in the log config or all dynamically but a hybrid of both generally isn’t clean as one simply replaces the other in it’s entirety. You can do both but it’s essentially redundant. Post the migration to 2.x I’ve found myself having to setup appenders and their loggers for all sessions statically using then log4j config. This is cumbersome as it relies heavily on getting the COMP IDs correct otherwise you’re going to be missing logs. Again in my case I have a code base that’s shared for many FIX clients and now it means that the log4j config is specific for each client where as before a lot was dynamic based on the .ini config FIX session info for each session so I only had to have a very simple log4j config that was shared be each FIX client. > On Mar 4, 2022, at 6:26 PM, Robert Nicholson <ro...@el...> wrote: > > In any case it all appears to be working now. > > I just had to correct an issue with the creation of the loggers that line up with the ones in Quickfix SLF4J based and it all worked. > >> On Mar 4, 2022, at 3:06 PM, Colin DuPlantis <co...@ma... <mailto:co...@ma...>> wrote: >> >> QFJ Documentation: http://www.quickfixj.org/documentation/ <http://www.quickfixj.org/documentation/> >> QFJ Support: http://www.quickfixj.org/support/ <http://www.quickfixj.org/support/> >> >> >> Nope, sorry >> >> On 3/4/22 12:28, Robert Nicholson wrote: >>> QFJ Documentation: http://www.quickfixj.org/documentation/ <http://www.quickfixj.org/documentation/> >>> QFJ Support: http://www.quickfixj.org/support/ <http://www.quickfixj.org/support/> >>> >>> >>> >>> Have you done it with a programmatically created appender? >>> >>> All works on my side when I’m using a statically created appender. >>> >>> The idea is to not have you statically create appender definition in .xml for each quickfixj.msg.Incoming/Outgoing but rather programmatically create a logger and appender for each. >>> >>> With 1.x this works without issue but with 1.x you don’t have to completely trash the existing log4j config and you can “hang” programmatically created appenders off an existing statically created logger. ie. quickfixj.msg >>> >>> But with 2.x you need to reconfigure the log4j each time you make change and so there’s as possibility that by the time you have done that that Quickfix SLF4J is not aware of those loggers. Even though in my case I believe I’m configuring log4j 2.x _prior_ to the SLF4J that runs in Quickfix via SLF4JLog >>> >>> Also, has anybody succeed in the above when using logback? >>> >>>> On Mar 4, 2022, at 9:51 AM, Robert Nicholson <rob...@gm... <mailto:rob...@gm...>> wrote: >>>> >>>> So I’m on an older version of quickfix pre 1.6 >>>> >>>> Does anybody know if it’s straightforward to get the SLF4J->Log4J2 working once you’re application supports Log4J2? >>>> >>>> Is there any changes needed with QuickFixJ code to use different SLF4J api when using Log4J2? >>>> >>>> Cheers. >>> >>> >>> >>> >>> _______________________________________________ >>> Quickfixj-users mailing list >>> Qui...@li... <mailto:Qui...@li...> >>> https://lists.sourceforge.net/lists/listinfo/quickfixj-users <https://lists.sourceforge.net/lists/listinfo/quickfixj-users> >> -- >> Colin DuPlantis >> Chief Architect, Marketcetera >> Download, Run, Trade >> https://www.marketcetera.com <https://www.marketcetera.com/>_______________________________________________ >> Quickfixj-users mailing list >> Qui...@li... <mailto:Qui...@li...> >> https://lists.sourceforge.net/lists/listinfo/quickfixj-users > |