-
-
Notifications
You must be signed in to change notification settings - Fork 42
Reactive.Logger
The Reactive.Logger
module monitors calls to the RX delegates OnNext, OnSubscribe, OnDispose, OnCompleted, OnError
This is a platform agnostic
module extends the IModelReactiveModules
to provide a list TraceSources allowing to configure them further. All reactive modules will be in this list.
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.
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.
To initialize the TraceSources that operate before model e.g. ModelMapper add the following to your configuration file (see How to: Create and Initialize Trace Sources).
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
<source name="ModelMapperModule" switchName="sourceSwitch" switchType="System.Diagnostics.SourceSwitch">
</source>
</sources>
<switches>
<add name="sourceSwitch" value="Verbose"/>
</switches>
</system.diagnostics>
</configuration>
Possible future improvements:
- Any other need you may have.
Let me know if you want me to implement them for you.
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.
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):
- We have
7
subscriptions/rows (7th column
) in theRXLoggerClientApp (2nd column)
from theOneView, Reactive, GridListEditor
modules (3rd column
). On4th column
we have thelocation
of each subscription. So from bottom to top, we can see that theOneViewModule 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 theGridListEditor and its RememberTopRow
method. Finally there is theReactiveModule
that subscribed to emitWhenWindowCreated 2 times and 1 WhenViewOneFrame
. - Now it's emit time
(OnNext) 6 times (7th column)
where we can understand that the the applicationIsLoggedOn
. TheWhenWindowCreated 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 anObjectSpace created
leading toCompatibilityChecked
. 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. - 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 - 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.
- The rest of the rows follow the same pattern with the GridListEditor and OneView modules on the lead.
-
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.
-
Ways to Register a Module or simply add the next call to your module constructor
RequiredModuleTypes.Add(typeof(Xpand.XAF.Modules.Reactive..Logger.ReactiveLoggerModule));
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.
.NetFramework: net461
DevExpress.ExpressApp.ConditionalAppearance | Any |
Fasterflect.Xpand | 2.0.7 |
JetBrains.Annotations | 2020.1.0 |
System.Reactive | 4.4.1 |
System.ValueTuple | 4.5.0 |
Xpand.Extensions | 2.202.57 |
Xpand.Extensions.Reactive | 2.202.58 |
Xpand.Extensions.XAF | 2.202.58 |
Xpand.Patcher | 2.0.24 |
Xpand.XAF.Modules.Reactive | 2.202.58 |
Xpand.VersionConverter | 2.202.10 |
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 constructor of your module.
Xpand.XAF.Modules.Reactive.ReactiveModuleBase.Unload(typeof(Xpand.XAF.Modules.Reactive.Logger.ReactiveLoggerModule))
The module is tested on Azure for each build with these tests. All Tests run as per our Compatibility Matrix