Topic Last Modified: 2013-03-07
Provides a command-line option for searching the centralized logging service log files. This cmdlet was introduced in Lync Server 2013.
Syntax
Search-CsClsLogging [-AsXml <SwitchParameter>]
[-CallId <String>] [-Components <String[]>] [-Computers
<String[]>] [-ConferenceId <String>] [-CorrelationIds
<String[]>] [-EndTime <DateTime>] [-IP
<IPAddress>] [-LogLevel <String>] [-MatchAll
<SwitchParameter>] [-MatchAny <SwitchParameter>]
[-OutputFilePath <String>] [-Phone <String>] [-Pools
<String[]>] [-SipContents <String>] [-SkipNetworkLogs
<SwitchParameter>] [-StartTime <DateTime>] [-Uri
<String>]
|
Examples
Example 1
The command shown in Example 1 searches for the IP address 192.168.0.242 in the log files found on the computer atl-cs-001.litwareinc.com.
Copy Code | |
---|---|
Search-CsClsLogging -Computers "atl-cs-001.litwareinc.com" -IP "192.168.0.242" |
Example 2
In Example 2, a search is made for entries that match both the IP address 192.168.0.242 and the Uri sip:kenmyer@litwareinc.com. The MatchAll parameter specifies that all the criteria must be met for an entry to be recorded as a match.
Copy Code | |
---|---|
Search-CsClsLogging -Computers "atl-cs-001.litwareinc.com" -IP "192.168.0.242" -Uri "sip:kenmyer@litwareinc.com" -MatchAll |
Example 3
The command shown in Example 3 searches for entries that match either the IP address 192.168.0.242 or the Uri sip:kenmyer@litwareinc.com. The MatchAny parameter specifies that just one of the criteria must be met for an entry to be recorded as a match.
Copy Code | |
---|---|
Search-CsClsLogging -Computers "atl-cs-001.litwareinc.com" -IP "192.168.0.242" -Uri "sip:kenmyer@litwareinc.com" -MatchAny |
Detailed Description
The centralized logging service (which replaces the OCSLogger and OCSTracer tools used in Microsoft Lync Server 2010) provides a way for administrators to manage logging and tracing for all computers and pools running Lync Server 2013. Centralized logging enables administrators to stop, start, and configure logging for one or more pools and computers by using a single command; for example, you can use one command to enable Address Book service logging on all your Address Book servers. This differs from the OCSLogger and OCSTracer tools, which had to be individually managed (including individually stopped and started) on each server. In addition, the centralized logging service also provides a way for administrators to search trace logs from the command, using the Windows PowerShell command-line interface and the Search-CsClsLogging cmdlet.
Centralized logging is built around a series of predefined scenarios that offer a more finely-targeted approach to logging than offered in previous versions of Lync Server. These scenarios predetermine the server components and logging for you; as a result, an administrator enabling the RGS scenario can be confident that he or she will only log information relevant to the Response Group service and not to, say, the audio conferencing provider service.
The Search-CsClsLogging cmdlet provides a command line option for searching the log files generated by the centralized logging service.
To return a list of all the role-based access control (RBAC) roles this cmdlet has been assigned to (including any custom RBAC roles you have created yourself), run the following command from the Windows PowerShell prompt:
Get-CsAdminRole | Where-Object {$_.Cmdlets –match "Search-CsClsLogging"}
Lync Server Control Panel: The functions carried out by the Search-CsClsLogging cmdlet are not available in the Lync Server Control Panel.
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
AsXml |
Optional |
System.Management.Automation.SwitchParameter |
When specified, return code information from each computer searched is returned in XML format instead of as a string value. |
CallId |
Optional |
System.String |
Call identifier to be searched for. |
Components |
Optional |
System.String[] |
Comma-separated list of components to be searched. |
Computers |
Optional |
System.String[] |
Comma-separated list of the computers to be searched. For example: -Computers "server-cs-001.litwareinc.com", "server-cs-002.litwareinc.com" |
ConferenceId |
Optional |
System.String |
Conference ID to be searched for. |
CorrelationIds |
Optional |
System.String[] |
Comma-separated list of correlation IDs to search for. A correlation is a 32 bit integer associated with each request. |
EndTime |
Optional |
System.DateTime |
Ending date and time for the log entries to be searched. Specified in local time zone. Defaults to 5 minutes after current time if no StartTime specified, otherwise defaults to 30 minutes after StartTime. For example, on computer running the US English version of Lync Server 2013, this syntax limits the search to entries recorded prior to 8:00 AM on August 31, 2012: -StartTime "8/31/2012 8:00AM" |
IP |
Optional |
System.Net.IPAddress |
IP address being searched for. This must be an actual IP address; you cannot use wildcards when specifying the address. |
LogLevel |
Optional |
System.String |
Specifies the minimum type of log entry to be returned. Allowed values are: * Fatal * Error * Warning * Info * Verbose * Debug * All "Minimum type of entry to be returned” means that the Search-CsClsLogging cmdlet will return all log entries at that level of severity plus all log entries with a higher level of severity. For example, if you set the LogLevel to Warning then the cmdlet will return entries marked as Fatal and Error as well as entries marked as Warning. |
MatchAll |
Optional |
System.Management.Automation.SwitchParameter |
When present, all the included criteria must be matched. This is similar to an AND query in SQL Server. |
MatchAny |
Optional |
System.Management.Automation.SwitchParameter |
When present, only one of the included criteria must be matched. This is similar to an OR query in SQL Server. This is the default. |
OutputFilePath |
Optional |
System.String |
When present, specifies the full path of where to write a text file containing the search results. Otherwise they are written to the console. |
Phone |
Optional |
System.String |
Phone number to be searched for. This number should be entered using the E.164 format and should not include wildcard characters. |
Pools |
Optional |
System.String[] |
Comma-separated list of the pools to be searched. For example: -Pools "atl-cs-001.litwareinc.com", "red-cs-001.litwareinc.com" |
SipContents |
Optional |
System.String |
Arbitrary text to search for within the body of a SIP message. |
SkipNetworkLogs |
Optional |
System.Management.Automation.SwitchParameter |
When present, instructs the Search-CsClsLogging cmdlet to avoid searching network logs. |
StartTime |
Optional |
System.DateTime |
Beginning date and time for the log entries to be searched. Specified in local time zone. Defaults to 30 minutes before EndTime. For example, on computer running the US English version of Lync Server 2013, this syntax limits the search to entries recorded at 8:00 AM on or after August 1, 2012: -StartTime "8/1/2012 8:00AM" |
Uri |
Optional |
System.String |
Uri to be searched for. |
Input Types
None. The Search-CsClsLogging cmdlet does not accept pipelined input.
Return Types
String values or XML.