This article describes how to collect Exchange ActiveSync device logs to troubleshoot sync issues between mobile devices and Exchange Online in Microsoft Office 365. If you can't sync your mobile device to your mailbox, you may be asked by Office 365 Support to collect logs for troubleshooting.
To capture ActiveSync device log information, use one of the following methods.
Run the following command to enable ActiveSync logging for a specific user:
Set-CASMailbox alias -ActiveSyncDebugLogging:$true
Reproduce the behavior that you want to capture.
Run the following command to retrieve the log:
Get-MobileDeviceStatistics -Mailbox alias -GetMailboxLog:$true -NotificationEmailAddresses "email@example.com"
Note This command retrieves the statistics for the mobile device that's set up to synchronize with the mailbox of the user who you specified. In this example, it also sends the log file to firstname.lastname@example.org.