Microsoft has finally decided that we are all big boys now and that we can make some decisions, including where the trace logging files should go. The TraceDirectory key in the registry still gets summarily ignored, but it is possible to change the directory using PowerShell. It's a fairly simple process:
- Start PowerShell.
- Load the CRM PS Snap in: Add-PSSnapin Microsoft.Crm.PowerShell
- Store Trace Settings into variable to allow easy editing: $trace = Get-CRMSetting TraceSettings
- Change Directory to your preferred value: $trace.Directory=”D:\Trace”
- Save Settings: Set-CRMSetting $trace
- You can check that the new setting has been set with: Get-CRMSetting TraceSettings
CallStack : True
Categories : *:Error
Directory : D:\Trace
Enabled : True
FileSize : 10
ExtensionData : System.Runtime.Serialization.ExtensionDataObject
Note that the directory on step 4 needs to exist.
If you haven’t enabled trace logging, you can do it before step 4:
$trace.Enabled =”True”
Thank you Microsoft.
No comments:
Post a Comment