Exchange 2013 heavily log the health of the server and all mail related actions and can fill up the main drive. There are two options to configure and move the log files to a separate dedicated log drive.
1. The first method is using an app called Junction from Sysinternals. You can create a symbolic link of the log folder and redirect to your desired drive. The folder has to be created by the app and cannot exist, therefore you need to rename your existing folder to log.old and then create one with the Junction. Of course the folder cannot be renamed while Exchange services are running, you need to do the whole process in safe mode. There are two locations where you need to create the sym link. The first called Logging and it is under C:\Program Files\Microsoft\Exchange Server\V15\. The second one called Logs and it is under C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles
Once you are done restart your server and make sure all services are running and everything looks good
2. The second method is to use PowerShell and Notepad to configure services where there is an option to do that. Let’s start with the PowerShell part. It’s pretty long but has all the settings I’m aware of.
Start to put the server name into a variable
$exchangeservername = $env:computername
Then run the following PS cmdlets
Set-TransportService -Identity $exchangeservername -ConnectivityLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\Connectivity"
Set-TransportService -Identity $exchangeservername -MessageTrackingLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\MessageTracking"
Set-TransportService -Identity $exchangeservername -IrmLogPath "L:\Program Files\Microsoft\Exchange Server\V15\Logging\IRMLogs"
Set-TransportService -Identity $exchangeservername -ActiveUserStatisticsLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ActiveUsersStats"
Set-TransportService -Identity $exchangeservername -ServerStatisticsLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ServerStats"
Set-TransportService -Identity $exchangeservername -ReceiveProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpReceive"
Set-TransportService -Identity $exchangeservername -RoutingTableLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\Routing"
Set-TransportService -Identity $exchangeservername -SendProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpSend"
Set-TransportService -Identity $exchangeservername -QueueLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\QueueViewer"
Set-TransportService -Identity $exchangeservername -WlmLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\WLM"
Set-TransportService -Identity $exchangeservername -PipelineTracingPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\PipelineTracing"
Set-TransportService -Identity $exchangeservername -AgentLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\AgentLog"
$EdgeSyncServiceConfigVAR=Get-EdgeSyncServiceConfig
Set-EdgeSyncServiceConfig -Identity $EdgeSyncServiceConfigVAR.Identity -LogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\EdgeSync"
Set-FrontendTransportService -Identity $exchangeservername -AgentLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\AgentLog"
Set-FrontendTransportService -Identity $exchangeservername -ConnectivityLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\Connectivity"
Set-FrontendTransportService -Identity $exchangeservername -ReceiveProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpReceive"
Set-FrontendTransportService -Identity $exchangeservername -SendProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpSend"
Set-ImapSettings -LogFileLocation "L:\Program Files\Microsoft\Exchange Server\V15\Logging\Imap4"
Set-MailboxServer -Identity $exchangeservername -CalendarRepairLogPath "L:\Program Files\Microsoft\Exchange Server\V15\Logging\Calendar Repair Assistant"
Set-MailboxServer -Identity $exchangeservername -MigrationLogFilePath "L:\Program Files\Microsoft\Exchange Server\V15\Logging\Managed Folder Assistant"
Set-MailboxTransportService -Identity $exchangeservername -ConnectivityLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\Connectivity"
Set-MailboxTransportService -Identity $exchangeservername -MailboxDeliveryAgentLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\AgentLog\Delivery"
Set-MailboxTransportService -Identity $exchangeservername -MailboxSubmissionAgentLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\AgentLog\Submission"
Set-MailboxTransportService -Identity $exchangeservername -ReceiveProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpReceive"
Set-MailboxTransportService -Identity $exchangeservername -SendProtocolLogPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\ProtocolLog\SmtpSend"
Set-MailboxTransportService -Identity $exchangeservername -PipelineTracingPath "L:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Mailbox\PipelineTracing"
Unload performance monitoring
add-pssnapin Microsoft.Exchange.Management.PowerShell.Setup
remove-perfcounters –definitionfilename “C:\Program Files\Microsoft\Exchange Server\V14\Bin\perf\AMD64\eseperf.xml
You can configure some of the monitoring porcesses through their config file. Search for MSExchangeHMWorker.exe.config and MSExchangeHMHost.exe.config files. In the config you can change either the max size of the log directory (MaxTraceLogDirectorySizeInBytes), the location of the logs (DefaultTraceLogPath) or disable entirely (IsTraceLoggingEnabled)
Also you can redirect IIS Logs just
Open IIS Manager
Select your server
In the Connections pane select Logging
Change the path for the log files
Note this change will apply to all of your sites hosted on the server