Microsoft Exchange administrators know that server logs are a necessary evil, especially if you need to keep copies of emails for quite some time. The problem is logs can take up a lot of precious space on a drive. For instance, when the server’s C drive reaches capacity and you’re unsure what to do, the Exchange log files are one of the first places to look.

Two ways to manage Exchange 2010 (and later) log files is with Windows Server Backup or circular logging. These solutions are drastically different, but both methods recover space on the server’s drive. Let’s look at each one and explore why you would want to enable either for your server.

Windows Server Backup

With the Windows Server Backup method, you commit the transactions and flush the logs (the logs being the piece that takes up the space). This ensures the data can be recovered, the piece of the system consuming your drive space is cleared, and you will have a backup of your data.

The nice thing about this approach is that all you have to do is create and regularly schedule the backup and let it run. In the act of completion of a backup, the Windows Server Backup tool will flush the logs.

Windows Server Backup is quite simple to set up, and there is no special step necessary to set up the flushing of the Exchange logs. By creating the scheduled backup using the Windows Server Backup Wizard (Figure A), you should be good to go.
Figure A

There is already a backup running to flush the Exchange logs. (Click the image to enlarge.)

I highly recommend scheduling this backup to run at a time when Exchange isn’t going to be in heavy usage. Depending on how much data the server has, this backup can take quite a while, so make sure you schedule the backup with plenty of time to complete before the start of the next business day.

This method of flushing the logs does not require any further work on the Exchange server–in particular, you do not have to make any changes within Exchange; for many admins, that makes this option the most logical and efficient. This is also the best option if you know you will only need to recover data up to the last backup. If you know you will need to retain more data than what was saved in the last backup, this is your best and possibly only option for saving space because, even though circular logging does a great job of keeping your drive space free, it does so with a price.

Circular logging

In the standard transaction logging used in Exchange 2010, a database transaction is first written to a log file and then written to a database. When that log file reaches one MB in size, it is renamed. After the previous log file is renamed, a new log file is created. This cycle continues and over time results in a set of log files. These files remain on the drive and can accumulate until there is no space remaining on the drive; this can cause a lot of problems.

You can avoid this issue by using the circular logging feature, which allows Exchange to overwrite transaction log files once the data contained with the log file is committed to the database. This method saves a lot of space, but you can only recover data up to the last backup. If your business requires the retention of multiple weeks, months, or years of Exchange data, circular logging is not the best method for you.

If circular logging is the method you need, here’s how to enable the feature:

  1. Log on to your Exchange server.
  2. Open the Exchange management console.
  3. Expand the Organizational Configuration.
  4. Click Mailbox.
  5. Select the database for which you want to enable circular logging.
  6. Click Properties.
  7. Click Enable Circular Logging (Figure B).
  8. Click OK.
  9. Open the Services tool, search for Exchange Information Store, and restart this service. Circular logging will now be in effect.

Figure B

If you change your mind, you can always go back and disable circular logging.