rappen / PluginTraceViewer

Investigate the Microsoft Dataverse Plugin Trace Log with easy filtering and display possibilities
https://JonasR.app/PTV
GNU General Public License v3.0
12 stars 5 forks source link

Find more records! #193

Open rappen opened 5 months ago

rappen commented 5 months ago

I may have missed how to find records.

czart8 commented 5 months ago

Is there a specific format I should use in logs to support this functionality?

rappen commented 5 months ago

Good question, @czart8 ! I'm doing it from my perspective at first. Me and my colleagues us the CanaryTracer.TraceContext https://jonasr.app/canary which is part of our PluginBase class. After that, I was looking at what I could find from Microsoft. Well a little bit from MS... And then, I asked in the community about their type of logging, where I implemented from Daryl LaBar's style and a sample from Data8.

I know this feature is a bit chance-implement, shooting from the hip you know...

It finds al Guid by a regex. For each guide, it tries to find the table it belongs to just before the guide. To find the tables, if removes all separate characters ' ', '\t', '\n', '\r', ':', ',', '=', '"', '\'', '(', ')' and get all characters until next separate char. Due to how other may have between "table" and "guide", I remove these texts "new Guid", ", Id", "with id". I'm sure this will expand when I find more examples.

Generally, I like to trace texts like:

Trace($"Updating {record.LogicalName} {record.Id}");

and that just words when trying to find records in PTV.

That's roughly it, but I also try to find it in other scenarios.

Code core is here: https://github.com/rappen/PluginTraceViewer/blob/master/PluginTraceViewer/Controls/TraceControl.cs

TheDaveCollective commented 5 months ago

May i suggest if you lookup a guid in the POA table it should then tell you what type it is. Rather than hoping people have used the right trace style, it will then also pickup guids in JSON etc.

rappen commented 5 months ago

Good ideas, @TheDaveCollective ! Can you send some example logs here so I can implement it? If the data is too sensitive, can you email it instead?

FredJoly commented 4 months ago

Any chance you could add a kind of whitelist to allow the tool to search custom entities? Our dynamics environment is heavily customized, and mostly avoids using OOTB functionality for various reasons. We have probably close to 300 custom entities.

In this case, I use the tool extensively to debug a set of workflows that operate on a set of about 4-5 custom entities (and the contact entity). Being able to tell the tool "hey, please check these 4-5 entities) would make this feature useful. Otherwise, as it stands, this feature is useless to me at the moment because it's not searching the correct tables. If it was, it could potentially save me a lot of logging, which would reduce the chance of exceeding the log limit.