(1 Aug 2012: Updated with information about the AlwaysOn scenario provided by Natasha the PM for CLS)
Centralized Logging Service (CLS) is a new feature in Lync Server 2013 Preview. It provides a mechanism to enable/disable logging across all Lync servers in a deployment from a single interface and to search the resulting logs from the same interface.
You specify what should be logged based on the scenario you want to investigate. The scenarios supported are AlwaysOn, MediaConnectivity, ApplicationSharing, AudioVideoConferencingIssue, HybridVoice, IncomingAndOutgoingCall, VoiceMail, IMAndPresence, AddressBook, DeviceUpdate, LYSSAndUCS, CLS, SP, WAC, UserReplicator, HostedMigration, MonitoringAndArchiving, LILRLegacy, LILRLYSS, MeetingJoin, RGS, CPS, XMPP and CAA.
The AlwaysOn scenario is special. CLS is designed to have that scenario running by default. This way, when you have an issue you do not have to turn on logging, repro the issues and then get your logs. The hope is that there is enough logging occurring with AlwaysOn that when you have an issue you will already have the logs available. If AlwaysOn does not provide you with enough logs, then you can turn on a particular scenario to get a more verbose set of logs.
CLS is implemented by agents and a controller used by the Lync administrator to interact with CLS.
The Lync Server Centralized Logging Service Agent service (also known as ClsAgent) is running on all Lync 2013 Preview servers in the deployment. The purpose of the agent is to respond to requests to enable/disable logging and to respond to search requests.
The Lync administrator controls the agents via the ClsController interface. ClsController is a program default installed into C:\Program Files\Common Files\Microsoft Lync Server 2013\ClsAgent. You can specify different parameters to ClsController. You can see detailed usage information about parameters and their values by just running ClsController without parameters.
The typical sequence of commands you want to run are:
For example to investigate an issue with UCS for a user on the lync.contoso.com pool:
The last invocation of ClsController will write the resulting log entries to standard output, so you might want to re-direct it to a file by using >.
You can get an understanding of which components are included in which CLS scenarios by the Lync Management Shell command Get-CsClsScenario. Below I’m showing how to find the components or providers in the CPS scenario:
Thanks for the post!
Are the text file readable by snooper in a pretty format like OCSLOGGER had done in the past?
Jens>Thanks Randy! Yes, it is.
I tried to use your script as well as to manually input commands. However, I don't get txt files with logs. All I get is a cache files and text file with the following content: “Success Code - 0, Message - The command SEARCH successful on 1 agents”.
Is anyone else facing the same problem.
Great addition to the troubleshooting tool bag.
i have the same problem with a Lync 2013 standalone server.
Did you fix it?
Would running the "old" ocslogger.exe on a wave 15 server lead to a major "code conflict" or other issue down the road??
Thanks for your article.
Jens>Thanks Bob. We advice not to run the two at the same time.
Search always fails with following error:
Error Code - 20018, Message - The command SEARCH failed on 1 agentsAgent - pool.domain.com, Reason - Error code - 87, Message - The parameter is incorrect - starttime
I've tried defining the start time in the search to no avail. Anyone else having this same problem? This is the public release Lync Server 2013 preview.
Hello from Lync 2013 Ignite in Scottsdale where when asked about logging, I was told to look here. I am surprised this is not part of the curriculum.
Also seeing this Reason - Error code - 87, Message - The parameter is incorrect - starttime
To work-around the error 87 starttime is incorrect issue, try to set the regional settings of the user running the CLS cmds to En-US and restart Lync Management Shell.
does anyone work out how to resolve the Error code - 87, Message - The parameter is incorrect - starttime?
if so, please advise how. thanks.
Jens>Leon, did you try my work-around with changing the date & time format to EN-US and restart Lync Server Management Shell?
yes i did. but still didn't work for me :(
Strange. Here is what I did on WIndows Server 2012 using Lync 2013 RTM.
First showing the issue:
PS C:\> get-date -Format g
PS C:\>Search-CsClsLogging -Computers lync.contoso..dk -Components lyss -LogLevel all -OutputFilePath c:\ud.txt
Starting search against 1 computers
Failed on 1 agents
Agent - lync.contoso.dk, Reason - Error code - 87, Message - The parameter
is incorrect - starttime.
I then went to Region settings, Formats and changed Format to English (United States) for the user I was signed in with. I then exited and started a new instance of Lync Management Shell. This is for it to pick up the change in region format. One can also see it in the get-date output.
11/30/2012 2:28 PM
PS C:\> Search-CsClsLogging -Computers lync.contoso.dk -Components lyss -LogLevel all -OutputFilePath c:\ud2.txt
Using start time 11/30/2012 2:02:51 PM
Using end time 11/30/2012 2:32:51 PM
Success Code - 0, Successful on 1 agents