We don’t recommend to enable circular logging in Exchange 2016. An excellent back-up system will truncate the database logs. What if the back-up didn’t work, and you need a solution before the disk size is getting full? This article will teach you how to enable circular logging with PowerShell and in Exchange Admin Center.
When to enable circular logging and clear the database logs? For example:
Don’t forget to disable circular logging when you have configured the back-up, when placing the database in production or finished migration.
In our example, we are going to look at the default mailbox database. I recommend to rename and move the default database to another disk. Before doing that, configure ReFS volume on the disk.
We have 1.681 items in the folder. That’s around 1.68 GB in total size. How to clear the logs from a particular database?
In the next step, we are going to enable circular logging in Exchange mailbox database.
Log in to Exchange Admin Center (EAC). Go to servers and follow with databases at the top. Click the mailbox database and click the edit icon.
Click maintenance in the left panel and check the checkbox Enable circular logging. Click Save.
A warning message will appear. The database needs to be dismount and remount before circular logging changes are being applied. Click OK to close the warning message.
Click the mailbox database and click the … icon. Click Dismount.
A warning will show up with the question if you are sure to dismount the mailbox database? Verify the name of the mailbox database and click Yes.
Have a look at the STATUS and verify that the mailbox database is Dismounted.
Mount the database. Click the … and click Mount.
A warning message will appear if you are sure to mount the mailbox database. Verify that it’s the correct mailbox database. When verified, click Yes.
Have a look at the STATUS and verify that the mailbox database is mounted.
Let’s go back to the Mailbox database folder and have a look at the logs.
All the database logs of that specific mailbox database are cleared successfully.
Run Exchange Management Shell as administrator. Check if circular logging is enabled on the mailbox database. We are going to use the Get-MailboxDatabase cmdlet.
[PS] C:\>Get-MailboxDatabase "Mailbox Database 1237333779" | Format-Table Name, CircularLoggingEnabled
Name CircularLoggingEnabled
---- ----------------------
Mailbox Database 1237333779 False
Circular logging is disabled. We are going to use the Set-MailboxDatabase cmdlet and CircularLoggingEnabled parameter to enable circular logging.
[PS] C:\>Set-MailboxDatabase "Mailbox Database 1237333779" -CircularLoggingEnabled $True
WARNING: Circular logging parameter change will not be applied on this database before it is remounted. Dismount and remount database "Mailbox Database 1237333779" in order to apply this parameter change.
A warning message will appear. The database needs to be remounted before circular logging changes are being applied. Let’s dismount the database and mount the database to have the changes being applied. Let’s verify the mount status after each command.
[PS] C:\>Dismount-Database "Mailbox Database 1237333779" -Confirm:$False
[PS] C:\>Get-MailboxDatabase "Mailbox Database 1237333779" -Status | Format-Table Name, Mounted
Name Mounted
---- -------
Mailbox Database 1237333779 False
[PS] C:\>Mount-Database "Mailbox Database 1237333779" -Confirm:$False
[PS] C:\>Get-MailboxDatabase "Mailbox Database 1237333779" -Status | Format-Table Name, Mounted
Name Mounted
---- -------
Mailbox Database 1237333779 True
Conclusion
In this article, you learned how to enable circular logging Exchange 2016 with PowerShell and Exchange Admin Center. You also learned how to enable circular logging in Exchange Admin Center. Don’t forget to disable circular logging.