Skip to content

Reactive.Logger

Apostolis Bekiaris edited this page Oct 10, 2019 · 18 revisions

GitHub issues GitHub close issues

About

The Reactive.Logger module monitors calls to the Reactive delegates (OnNext, OnSubscribe, OnDispose, OnCompleted, OnError) and persists the calls info in the application datastore. For more head to the details section.

Installation

  1. First you need the nuget package so issue this command to the VS Nuget package console

    Install-Package Xpand.XAF.Modules.Reactive.Logger.

    The above only references the dependencies and nexts steps are mandatory.

  2. Ways to Register a Module or simply add the next call to your module constructor

    RequiredModuleTypes.Add(typeof(Xpand.XAF.Modules.Reactive.LoggerModule));

The module is not integrated with any eXpandFramework module. You have to install it as described.

Versioning

The module is not bound to DevExpress versioning, which means you can use the latest version with your old DevExpress projects Read more.

The module follows the Nuget Version Basics.

Dependencies

.NetFramework:

DevExpress.ExpressApp Any
DevExpress.Persistent.Base Any
DevExpress.ExpressApp.ConditionalAppearance Any
DevExpress.Xpo Any
Fasterflect.Xpand 2.0.6
System.Reactive 4.1.6
Xpand.XAF.Modules.Reactive 1.2.57
Xpand.VersionConverter 1.0.34

Issues-Debugging-Troubleshooting

To Step in the source code you need to enable Source Server support in your Visual Studio/Tools/Options/Debugging/Enable Source Server Support. See also How to boost your DevExpress Debugging Experience.

If the package is installed in a way that you do not have access to uninstall it, then you can unload it with the next call at the contructor of your module.

Xpand.XAF.Modules.Reactive.ReactiveModuleBase.Unload(typeof(Xpand.XAF.Modules.Reactive.Logger.ReactiveLoggerModule))

Details

The module extends the IModelReactiveModules to provide a list TraceSources allowing to configure them further. All reactive modules will be in this list. image

All messages are stored in the local database using the TraceEvent BO and you can visualize them in ListView as shown in the next shot. image

All messages are buffered until after the logon where we have a valid database and then stored in the database. However there is also a file logging which happens on Realtime and can be found in path with the _RXLogger.log suffix.

Tests

The module is tested on Azure for each build with these tests

Examples

The module can be used with all packages that use the API from Xpand.XAF.Modules.Reactive. It will persist the calls to the datastore using the TraceEvent object. Below we analyze what the logger logs when used from the Xpand.XAF.Modules.Reactive.Logger.Client.Win. image Clarification: The client application is designed to received the remote logs in real-time of other XAF applications, it does it using the RX API because the ReactiveLogger, ReactiveLoggerHub, OneView, GridListEditor and Reactive modules are installed, so this means it is like just any other XAF application and can log itself the same way. Let us analyze what we see when it starts reading it from bottom to top (Please give a brief to the previous links to understand better the analysis):

  1. We have 7 subscriptions/rows (7th column) in the RXLoggerClientApp (2nd column) from the OneView, Reactive, GridListEditor modules (3rd column). On 4th column we have the location of each subscription. So from bottom to top, we can see that the OneViewModule ShowView and HideMainWindow methods will execute, apparently doing what their names implies but we do not know when this will happen, at the moment its only a subscription. We also see the same with the GridListEditor and its RememberTopRow method. Finally there is the ReactiveModule that subscribed to emit WhenWindowCreated 2 times and 1 WhenViewOneFrame.
  2. Now it's emit time (OnNext) 6 times (7th column) where we can understand that the the application IsLoggedOn. The WhenWindowCreated called 3 times which makes partially sense as we only had 2 subscription from step 1, probably the other one was before our analysis start. Next we see that an ObjectSpace created leading to CompatibilityChecked. Here we have again multiple emition from these method which makes it unclear what is happening but we can also guess depending on past and future calls. Either way we know that we are just after logon when at least one ObjectSpace was just created therefore the database exists.
  3. From step 2 we know we after logon therefore the user model is also merged giving the signal to the ReactiveLoggerHubModule which gets the 30 listening ports 61456, 61486 (last column) with the
  4. Trash these rows as they do not tell us more than that an ObjectSpaceCreated or using the powerful DevExpress Grid, filter out the Reactive modules calls as it tends to get chatty.
  5. The rest of the rows follow the same pattern with the GridListEditor and OneView modules on the lead.
You can’t perform that action at this time.