Overview of ULS – Unified Logging Service

http://msdn.microsoft.com/en-us/library/ff512738.aspx

In SharePoint Foundation, ULS exposes configurable settings in two ways, through the:

  • object model
  • Windows PowerShell cmdlets

** Object Model — In SharePoint Foundation 2010 it is recommended that you use the SPDiagnosticsServiceBase to access ULS logs, specifically the WriteTrace() and WriteEvent() methods. SPDiagnosticsServiceBase class wraps all calls to the IDiagnosticsManager class.

http://msdn.microsoft.com/en-us/library/ff512746.aspx

Write to Trace Log

using Microsoft.SharePoint.Administration;

WriteTrace(System.UInt32, Microsoft.SharePoint.Administration.SPDiagnosticsCategory, Microsoft.SharePoint.Administration.TraceSeverity, System.String, System.Object[]);

Write to Event Log

using Microsoft.SharePoint.Administration;

WriteEvent(System.UInt16,Microsoft.SharePoint.Administration.SPDiagnosticsCategory,Microsoft.SharePoint.Administration.EventSeverity,System.String,System.Object[]);

——————————————————————————————————————————————
Windows powershell –

http://msdn.microsoft.com/en-us/library/ff595318.aspx

Get-SPDiagnosticConfig

Retrieves Diagnostic Configuration values.

Diagnostic Configuration

Set-SPDiagnosticConfig

Allows setting Diagnostic Configuration values.

Diagnostic Configuration

Get-SPLogLevel

Returns IDiagnosticsLevel2 objects or displays a list of diagnostics levels.

Trace Log and Event Log Throttling

Set-SPLogLevel

Allows the user to set the trace and event level for a set of categories.

Trace Log and Event Log Throttling

Clear-SPLogLevel

Resets the trace and event levels back to their default values.

Trace Log and Event Log Throttling

New-SPLogFile

Ends the current log file and starts a new one.

Log File Control

Get-SPLogEvent

Reads/queries ULS trace logs.

Trace Log Querying and Filtering

Merge-SPLogFile

Combines trace log files from all farm servers into a single file.

Trace Log Merging

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: