
Although Microsoft did not document this feature yet, it is possible to set a custom location for your log files for Microsoft Defender for Identity since sensor version 2.197. In this short blog post, I will describe how to set up a custom location for the Microsoft Defender for Identity log files.
Introduction
The Microsoft Defender for Identity logs provides insight into what each component of the Microsoft Defender for Identity sensor is doing at any given time. Recently you did not have the option to save the log files in a different location than the default.
Set Custom Location
Once you have installed version 2.197 of the Microsoft Defender for Identity sensor, you will see a new entry in the SensorConfiguration.json file containing a “SensorCustomLogLocation” option.
{
"$type": "SensorMandatoryConfiguration",
"SecretManagerConfigurationCertificateThumbprint": "",
"SensorCustomLogLocation": null,
"SensorProxyConfiguration": null,
"WorkspaceApplicationSensorApiWebClientConfigurationServiceEndpoint": {
"$type": "EndpointData",
"Address": "thalpiussensorapi.atp.azure.com",
"Port": 443
}
}
Changing the SensorCustomLogLocation to any path you like and restarting the service is enough to set the custom location.
{
"$type": "SensorMandatoryConfiguration",
"SecretManagerConfigurationCertificateThumbprint": "",
"SensorCustomLogLocation": "c:\\logs",
"SensorProxyConfiguration": null,
"WorkspaceApplicationSensorApiWebClientConfigurationServiceEndpoint": {
"$type": "EndpointData",
"Address": "thalpiussensorapi.atp.azure.com",
"Port": 443
}
}
You can also use the argument “logsPath” during the installation to set a custom location.
"Azure ATP Sensor Setup.exe" logspath="c:\logs"
You will end up with the log files in a custom location.

Conclusion
Although log files have a maximum of 50 MB and the oldest get deleted after ten consecutive files, there are circumstances when you do not want the log files in the default location. Maybe you already have something in place to send files to your SIEM solution, and you want a single folder to store all log files for your domain controller. Anyway, with version 2.197, you can ☺️