By default, all SharePoint logs are stored on the C: drive. This is not recommended, however, because on the one hand this causes performance loss (depending on the configuration) and on the other hand there is a risk that the system drive will be full and the OS will crash.

Logs can be easily moved using PowerShell. The following commands must be executed on each SharePoint server in the SharePoint 2016 Management Shell.

How to move the IIS logs is described here: Moving IIS Log Files (using PowerShell)

Moving Trace Logs
The trace logs can be moved using Central Administration > Monitoring > Reporting > Configure diagnostic logging, in which the path is changed in the Trace Logs section. In my example, the new path is D: \Logs\SharePoint\TraceLogs

Or you can run the following command in the SharePoint 2016 Management Shell:
Set-SPDiagnosticConfig -LogLocation «D:\Logs\SharePoint\TraceLogs»

Moving Usage Logs
The usage logs can be moved via Central Administration > Monitoring Reporting > Configure usage and health data collection, where the path is changed in the Usage Data Collection Settings section. In my example, the new path is D:\Logs\SharePoint\UsageLogsChange Usage Logs path

Or you can run the following command in the SharePoint 2016 Management Shell:
Set-SPUsageService -UsageLogLocation «D:\Logs\SharePoint\UsageLogs»