Configure usage and health data collection (SharePoint Foundation 2010)
Applies to: SharePoint Foundation 2010
This article provides information about configuring usage and health data collection in Microsoft SharePoint Foundation 2010.
The system writes usage and health data to the logging folder and to the logging database. To configure settings for the logging database, you must use Windows PowerShell.
In this article:
To configure usage and health data logging by using Central Administration
To configure usage data logging using Windows PowerShell
To enable or disable usage data logging for a specific event type using Windows PowerShell
To log usage data in a different Logging Database using Windows PowerShell
Note
You cannot configure health data collection settings by using Windows PowerShell.
Configure usage and health data collection by using Central Administration
You can use only Central Administration to configure usage and health data collection.
To configure usage and health data collection by using Central Administration
Verify that the user account performing this procedure is a member of the Farm Administrators group.
Note
The usage and health data settings are farm-wide and cannot be set for individual servers in the farm.
In Central Administration, on the Home page, click Monitoring.
On the Monitoring page, in the Reporting section, click Configure usage and health data collection.
On the Configure usage and health data collection page, in the Usage data collection section, enable usage data collection by selecting the Enable usage data collection text box.
In the Event Selection section, select the events to log by selecting the check box next to the events in the Events to log list.
Note
Logging uses system resources and can affect performance and disk usage. Only log those events for which you want regular reports. For ad hoc reports or investigations, enable logging for specific events, and then disable logging for the events after the report or investigation is complete.
In the Usage data collection settings section, type the path of the folder you want usage and health information to be written to in the Log file location box. The path that you specify must exist on all farm servers.
Note
These settings are applied to all events. To set event collection settings for individual event types, you must use Windows PowerShell.
Type the maximum disk space for the logs in gigabytes (between 1 and 20 GB) in the Maximum log file size box.
In the Health data collection section, select the Enable health data collection check box. To change the collection schedules, click Health Logging Schedule. A list of timer jobs that collect health data is listed. Click any of the timer jobs to change its schedule, or disable that timer job.
In the Logging Database Server section, to change the authentication used, select either the Windows authentication or SQL authentication option.
Note
To change the Database Server and Database Name values, you must use Windows PowerShell.
Configure usage data collection by using Windows PowerShell
Note
You can configure usage data collection by using Windows PowerShell, but you cannot configure health data collection by using Windows PowerShell.
To configure usage data collection by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:
Set-SPUsageService [-LoggingEnabled {1 | 0}] [-UsageLogLocation <Path>] [-UsageLogMaxSpaceGB <1-20>] [-Verbose]
Important
You must specify a path for
UsageLogLocation
that exists on all farm servers.Enable usage data logging by typing
-LoggingEnabled 1
. Specify the maximum amount of drive space used for logging with theUsageLogMaxSpaceGB
parameter.
For more information, see Set-SPUsageService.
To configure usage data collection for a specific event type by using Windows PowerShell
The event types listed on the Configure usage and health data collection page in Central Administration are the same as Usage Definitions in Windows PowerShell. You can use only Windows PowerShell to configure usage definitions individually. Moreover, you can configure only the DaysRetained
setting.
To configure usage data logging for a specific event type using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:
Set-SPUsageDefinition -Identity <GUID> [-Enable] [-DaysRetained <1-30>] [-Verbose]
Use the
Enabled
switch to enable usage logging for this usage definition. UseDaysRetained
to specify how long the usage data is retained in the log before being deleted. The range is 1 to 30 days. To view the progress of the command, use theVerbose
parameter.
For more information, see Set-SPUsageDefinition.
Log usage data in a different logging database by using Windows PowerShell
Note
You can use only Windows PowerShell to change this setting.
To log usage data in a different logging database by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:
Set-SPUsageApplication -DatabaseServer <Database server name> -DatabaseName <Database name> [-DatabaseUsername <User name>] [-DatabasePassword <Password>] [-Verbose]
You must specify the value for the
DatabaseServer
parameter, even if the new database is on the same database server as the old one. You must use both theDatabaseUsername
and theDatabasePassword
parameters if the database owner is a different user account that the one you with which you are logged on. To view the progress of the command, use theVerbose
parameter.
For more information, see Set-SPUsageApplication.
See Also
Concepts
Monitoring overview (SharePoint Foundation 2010)
Other Resources
Resource Center: Installation and Deployment for SharePoint Foundation 2010