Introduction
In this post, we’ll do a walk through on how to enable receive connector logging, where to find the logs or move the receive connector log path.
- Enable Receive Connector Logging
- Receive Connector Log Path
- Change the Receive Connector Log Path and other settings
- Disable Receive Connector Logging
Enable Receive Connector Logging
To enable receive connector logging for a single receive connector, e.g. Relay 1 on server LITEX01:
Set-ReceiveConnector “LITEX01Relay 1” -ProtocolLogging Verbose
To enable receive connector logging for all receive connector on a particular server, e.g. server LITEX01:
Get-ReceiveConnector -Server LITEX01 | Set-ReceiveConnector -ProtocolLogging Verbose
Receive Connector Log Path
If you read the background infromation on receive connectors here, you’ll see that there are two services involved in email transport and each has its own receive connectors:
- Front End Transport Service
- Transport Service
They also each have their own receive connector protocol log path.
Front End Transport Service Receive Connector Log Path
The default for the Front End Transport Service is: “C:Program FilesMicrosoftExchange ServerV15TransportRolesLogsFrontEndProtocolLogSmtpReceive”
You can check the Front End Transport Service receive connector log path by running the below command which outputs the path for the server LITEX01:
Get-FrontendTransportService -Identity LITEX01 | fl ReceiveProtocolLogPath
Transport Service Receive Connector Log Path
The Transport Service receive connector log path is: “C:Program FilesMicrosoftExchange ServerV15TransportRolesLogsHubProtocolLogSmtpReceive”
You can check the log path by running this command for server LITEX01:
Get-TransportService -Identity LITEX01 | fl ReceiveProtocolLogPath
Change the Receive Connector Log Path and other settings
In this section, we’ll look at how to change the log path and other settings for the Front End Transport Service and the Transport Service.
Front End Transport Service
We can confirm the current settings by running the command below:
Get-FrontEndTransportService -Identity LITEX01 | fl Receive*
Here we can see that logs are stored for a maximum of 30 days, each log file can grow to 10MB and the maximum log directory size is 250MB. The log path is also listed.
There may be some requirements to store receive connector logs for more than 30 days. In this case, you can increase the maximum directory size to 500MB and the maximum age to 60 days using this command:
Set-FrontEndTransportService -Identity LITEX01 -ReceiveProtocolLogMaxAge 60.00:00:00 -ReceiveProtocolLogMaxDirectorySize 500MB
You can also change the log path. For example, this command changes the log path to E:LogsFrontend:
Set-FrontEndTransportService -Identity LITEX01 -ReceiveProtocolLogPath E:LogsFrontend
New logs are now written to the new path without requiring a restart of any services:
Transport Service
We can confirm the current settings by running the command below:
Get-TransportService -Identity LITEX01 | fl Receive*
Here we can see that logs are stored for a maximum of 30 days, each log file can grow to 10MB and the maximum log directory size is 250MB. The log path is also listed.
There may be some requirements to store receive connector logs for more than 30 days. In this case, you can increase the maximum directory size to 500MB and the maximum age to 60 days using this command:
Set-TransportService -Identity LITEX01 -ReceiveProtocolLogMaxAge 60.00:00:00 -ReceiveProtocolLogMaxDirectorySize 500MB
You can also change the log path. For example, this command changes the log path to E:LogsHub:
Set-TransportService -Identity LITEX01 -ReceiveProtocolLogPath E:LogsHub
New logs are now written to the new path without requiring a restart of any services:
Disable Receive Connector Logging
When you’re done with troubleshooting, you can disable receive connector logging.
To disable receive connector logging for a single receive connector, e.g. Relay 1 on server LITEX01:
Set-ReceiveConnector “LITEX01Relay 1” -ProtocolLogging None
To disable receive connector logging for all receive connector on a particular server, e.g. server LITEX01:
Get-ReceiveConnector -Server LITEX01 | Set-ReceiveConnector -ProtocolLogging None
Conclusion
In this post, I’ve demonstrated how to enable receive connector logging, where to find the logs and how to change logging settings such as the log path and the amount of logs that are stored.