RE: Log standard searches
To write the plugin, you want to:
- Create a new plugin registered on the RetrieveMultiple event, with "none" as the entity. It will run for views, advance finds or even SDK requests for every entity in CRM.
- In the plugin code, make sure the MessageName is RetrieveMultiple, and that the InputParameters contains Query (that will be the query coming that was run)
- The Query property will be either a FetchExpression or QueryExpression depending on where the query was initiated from.
- When you have your expression, log it with your logger.