Thursday, May 16, 2013

Configuring what gets logged in SharePoint 2010 logging database

Configuring what gets logged

The SharePoint 2010 logging database covered in the previous recipe captures information that can be modified via the Central Administration interface. The advantage of this being that the collection of information can be voluminous, which can also be the disadvantage.
Disk space, I/O, and just the amount of data needed to retain this information can become an issue. Being able to reduce the type of information that gets captured is critical to the wellness of your farm.
In this recipe, we will cover how to change what gets captured and put into the logging database.

Getting ready

You must have farm-level administrative permissions to the Central Administration site.

How to do it...

  1. Open the SharePoint 2010 Central Administration website.
  2. Click Monitoring.
  3. Under the Reporting section, click Configure usage and health data collection.
  4. The following form appears for configuration:
    Fill in the following details:
    • Usage Data Collection: This is enabled by default.
    • Event Selection: These are specific events that are being logged. Use the check box to enable or disable them.
    • Usage data collection settings: In this section, the location of the ULS logs are set. Also, there is a setting to limit the size of the log file.
    • Health data collection: This is enabled by default.
    • Log Collection Schedule: Administrator has the ability to change the schedule.
  5. Modify the settings in step 4 and click OK.

How it works...

The options presented in the usage and health data collection are logged to the logging database and to the ULS logs.
The health logging schedule can be modified to fit the needs (also known as Service Level Agreements) of your organization. It is important to remember that there is a hidden cost associated with the increased logging. The hidden cost is mainly in the form of storage and possibly performance.
The ULS logs have the potential to grow large. The logs can be moved to a new physical location (physical spindle), which does not contain the operating system or WFE/Application server software. The physical location reference must exist on all servers in the farm.
The location of the logs is set within Central Administration. To access the setting, go to Central Administration, click Monitoring, and then select Configure diagnostic logging. Under the Trace Log section is the Path. This contains the location of the ULS logs.

There's more...

The logging information is retained for a period of 14 days by default. Using PowerShell you can change this parameter, using the following command:

Set-SPUsageDefinition -Identity [-Enable] -DaysRetained 14

No comments:

Post a Comment