Skip to content

Enable circular logging in Exchange Server

We don’t recommend to enable circular logging in Exchange Server. That’s because an excellent backup system will truncate the database logs. What if the backup didn’t work, and you need a solution before the disk size gets full? This article will learn how to enable circular logging with PowerShell and in Exchange Admin Center.

Should I enable circular logging in Exchange Server?

When to enable circular logging and clear the database logs? For example:

  • The disk is getting full, and you are not able to expand the disk.
  • There are problems with the backup software, and the logs are increasing.
  • Migrating mailboxes to that particular database.
  • The database is configured in a test environment.

Note: Don’t forget to disable circular logging after configuring the backup, placing the database in production, or finishing migration.

Before enabling circular logging

In our example, we will look at the default mailbox database. We 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?

Enable circular logging Exchange 2016 before enabling

In the next step, we will enable circular logging in Exchange mailbox database.

Enable circular logging Exchange in EAC

To enable circular logging in Exchange Admin Center, follow these steps:

1. Sign in to Exchange Admin Center (EAC).

2. Go to servers > databases.

3. Click the mailbox database and click the edit icon.

4. Click maintenance in the left panel.

5. Check the checkbox Enable circular logging.

6. Click Save.

Enable circular logging Exchange 2016 enable

7. A warning message will appear. The database needs to be dismounted and remounted before circular logging changes are applied. Click OK to close the warning message.

Warning
Circular logging parameter change will not be applied on this database before it is remounted. Dismount and remount database “Mailbox Database” in order to apply this parameter change.

Enable circular logging Exchange 2016 warning remount

8. Click the mailbox database and click the icon.

9. Click Dismount.

10. A warning will appear with the question if you are sure to dismount the mailbox database? Verify the name of the mailbox database and click Yes.

Enable circular logging Exchange 2016 warning dismount

11. Look at the STATUS and verify that the mailbox database is Dismounted.

12. Mount the database. Click the and click Mount.

13. A warning message will appear if you are sure to mount the mailbox database. Verify that it’s the correct mailbox database. When confirmed, click Yes.

Enable circular logging Exchange 2016 warning mount

14. Look at the STATUS and verify that the mailbox database is mounted.

Enable circular logging Exchange with PowerShell

To enable circular logging with PowerShell, follow the below steps:

1. Run Exchange Management Shell as administrator.

2. Check if circular logging is enabled on the mailbox database and run the Get-MailboxDatabase cmdlet.

The output shows that circular logging is disabled.

[PS] C:\>Get-MailboxDatabase "Mailbox Database 1237333779" | Format-Table Name, CircularLoggingEnabled

Name                        CircularLoggingEnabled
----                        ----------------------
Mailbox Database 1237333779                  False

3. Run 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.

4. A warning message will appear. The database needs to be remounted before circular logging changes are applied.

Warning
Circular logging parameter change will not be applied on this database before it is remounted. Dismount and remount database “Mailbox Database” in order to apply this parameter change.

5. Let’s dismount the database and mount the database to have the changes applied. Let’s verify the database 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

Enable circular logging on specific Exchange Server

If you want to enable circular logging on all the mailbox databases that are mounted on a specific Exchange Server, follow these steps:

1. Run Exchange Management Shell as administrator.

2. Enable circular logging on all mailbox databases mounted on the specific Exchange Server.

[PS] C:\>Get-MailboxDatabase | where {$_.Server -like "EX01-2016"} | Set-Mailboxdatabase -CircularLoggingEnabled $True

3. Check that circular logging is enabled on all mailbox databases on the specific Exchange Server.

[PS] C:\>Get-MailboxDatabase | where {$_.Server -like "EX01-2016"} | Sort Name | Format-Table Name, CircularLoggingEnabled

4. Dismount all the mailbox databases on the specific Exchange Server.

[PS] C:\>Get-MailboxDatabase | where {$_.Server -like "EX01-2016"} | Dismount-Database -Confirm:$False

5. Check that all mailbox databases are dismounted on the specific Exchange Server.

[PS] C:\>Get-MailboxDatabase -Status | where {$_.Server -like "EX01-2016"} | Sort Name | Format-Table Name, Server, Mounted

6. Mount all the databases on the specific Exchange Server.

[PS] C:\>Get-MailboxDatabase | where {$_.Server -like "EX01-2016"} | Mount-Database -Confirm:$False

7. Verify that the mailbox databases are mounted on the specific Exchange Server.

[PS] C:\>Get-MailboxDatabase -Status | where {$_.Server -like "EX01-2016"} | Sort Name | Format-Table Name, Server, Mounted

Results after enabling circular logging

Let’s return to the mailbox database folder and look at the logs.

Enable circular logging Exchange 2016 after enabling

All the database logs of that specific mailbox database cleared successfully.

That’s it!

Keep reading: Truncate Exchange logs with PowerShell »

Conclusion

You learned how to enable circular logging in Exchange Server with PowerShell and Exchange Admin Center. Don’t forget to remount the mailbox database before the change takes effect.

Did you enjoy this article? You may also like to read Create email address policy in Exchange Server. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *