Hi,
I need to reproduce what is done by the XPO Profiler but for my specific needs, which will include writing a replacement profiler for the XPO Profiler which will give automatic warnings for common pitfalls (like SELEC N+1) in XPO programming (this will be extensible, so new warnings will be added with time). I also need this to provide some ORTHOGONAL functionality which I don't want to introduce as part of the object model, or inheriting from Session/Unit of Work, and the data provided to the XPO Profiler is everything I need to accomplish that. For the orthogonal features I won't be needing any channel to communicate with another process (no need to send the "log" via TCP/IP or WCF), all I will need is to analyze the "log" and persist some info. This will only be "effective" when a configuration parameter is present so it won't affect production code performance.
So, what I need are directions on which classes to use to reproduce the desired behavior… Will that be DataStoreLogger? For the specialized profiler could I use LogClient and LogServer?
I'm also planning on providing a Log4Net / NLog implementation instead of the custom made implementation DevExpress introduced (I was really wondering why you didn't use it already) as NLog can targe database, file and even TCP/IP so no need, perhaps, to reinvent the wheel with LogClient… Will the DataStoreLogger be the right class to use to trap the log events and send them using NLog?
This is a very important case, because our production application used to be SaaS, but there are a few clients who just bought (for a high price!) the application to run on their premises, and it is now crucial to implement everything I stated in this case, in a very quick timeframe (I've got 2 to 3 weeks at most to have this implemented, working and tested!) so pointing me in the right direction would be the single most important support you ever offered me throught all these years.
Sample code for using the DataStoreLogger (if that's the class to use) , or an article on it, would be very welcome.
How to create a XPO logger similar to what XPO Profiler
Answers approved by DevExpress Support
Hello Felipe,
The DataStoreLogger solution can be considered outdated now, because it logs only the text of queries.
We advise you use the new and more modern system, which we, in particular, leverage in the XPO Profiler.
Please consider the following alternatives:
- Create your ILogger implementation and set it as default at the application startup: LogManager.SetTransport(logger);
- Reuse our own LoggerBase implementation and customize it according to your exact needs.
- Configure your application exactly as it is done for the XPO profiler use and then access it remotely via the LogClient class - just pass the host and port number into it.
Please note that the aforementioned APIs are undocumented and they may be subject to change without notice in the future. We will not be able to provide any formal support on these internal APIs either, so use them at your own risk and learn more on how they work from the source code of our product. If you are not hesitant of researching the framework's source code on your own, then you may find the contents of the …\DevExpress.Data\Logger\ directory helpful.
I hope you find this information helpful.
Dennis,
In less than 30 minutes I've already built a Console logger just by using LogClient… No need to write my own ILogger!!! (Which I'll need ultimately because I want to add Stack Trace information to the logs…)
But that was really fast!!!
Thank you once again!!!