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 lync.contoso.com pool:
- ClsController.exe -start –scenario lyssanducs –pools lync.contoso.com
- Repro issue
- ClsController.exe -stop –scenario lyssanducs –pools lync.contoso.com
- ClsController.exe -flush –pools lync.contoso.com
- ClsController.exe -search –pools lync.contoso.com –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) { $sc.name }
CpsDiagnostics
CpsHostingFramework
CpsOrbit
Collaboration
S4
Sipstack
Comments
Anonymous
January 01, 2003
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.Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
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.Anonymous
January 01, 2003
Great addition to the troubleshooting tool bag.Anonymous
August 01, 2012
The comment has been removedAnonymous
August 07, 2012
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. DamianAnonymous
August 15, 2012
Hi Damien, i have the same problem with a Lync 2013 standalone server. Did you fix it? ckueverAnonymous
August 17, 2012
Jens: 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. Bob Jens>Thanks Bob. We advice not to run the two at the same time.Anonymous
August 26, 2012
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.Anonymous
August 29, 2012
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.Anonymous
November 23, 2012
Also seeing this Reason - Error code - 87, Message - The parameter is incorrect - starttime Pretty stuck..Anonymous
November 28, 2012
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?Anonymous
November 29, 2012
hi Jens, yes i did. but still didn't work for me :(Anonymous
July 28, 2014
I found that -starttime and -endtime accept only TIME values, not dates.
"-starttime 05:52" or such works for me.