Using Centralized Logging Service in Lync Server 2013 Preview

(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:

  • ClsController.exe -start –scenario <scenario> –pools <pool fqdn>
  • Repro issue
  • ClsController.exe -stop –scenario <scenario> –pools <pool fqdn>
  • ClsController.exe  -flush –pools <pool fqdn>
  • ClsController.exe  -search –pools <pool fqdn> –components <component> –loglevel <loglevel>

For example to investigate an issue with UCS for a user on the pool:

  • ClsController.exe -start –scenario lyssanducs –pools
  • Repro issue
  • ClsController.exe -stop –scenario lyssanducs –pools
  • ClsController.exe -flush –pools
  • ClsController.exe -search –pools –components lyss –loglevel verbose

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:

  • PS C:\> $scenario=Get-CsClsScenario global/cps
  • PS C:\> foreach ($sc in $scenario.provider) { $ }

Comments (14)

  1. Anonymous says:

    Hi Jens, Do you know if CSCLS turns logging on in servers like exchange when its a partner application?

    Jens>Hi. No, it will only do it for Lync servers.

  2. Strange. Here is what I did on WIndows Server 2012 using Lync 2013 RTM.

    First showing the issue:

    PS C:> get-date -Format g

    30-11-2012 14:26

    PS C:>Search-CsClsLogging -Computers -Components lyss -LogLevel all -OutputFilePath c:ud.txt

    Starting search against 1 computers

    Failed on 1 agents

    Agent –, 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.

    PS C:> get-date -Format g

    11/30/2012 2:28 PM

    PS C:> Search-CsClsLogging -Computers -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

    Starting search against 1 computers

    Success Code – 0, Successful on 1 agents

  3. 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.

  4. ALANMAD says:

    Great addition to the troubleshooting tool bag.

  5. Randy Wintle says:

    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.

  6. Great post! says:

    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.


  7. ckuever says:

    Hi Damien,

    i have the same problem with a Lync 2013 standalone server.

    Did you fix it?


  8. Rocky19xx says:


    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.

  9. Steve says:

    Search always fails with following error:

    Error Code – 20018, Message – The command SEARCH failed on 1 agentsAgent –, 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.

  10. Chris Lehr says:

    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.

  11. thomas says:

    Also seeing this Reason – Error code – 87, Message – The parameter is incorrect – starttime

    Pretty stuck..

  12. Leon says:

    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?

  13. Leon says:

    hi Jens,

    yes i did. but still didn't work for me 🙁

  14. Stephan van Helden says:

    I found that -starttime and -endtime accept only TIME values, not dates.

    "-starttime 05:52" or such works for me.

Skip to main content