Configuring which cookies to log in the Site Analysis log

When you enable server side data logging, by default it logs all the cookies for every log event, which means even LTPAToken and portalFlyoutIsOpen, this clutters your sa.log file and makes it difficult to read


localhost.localdomain - wasadmin [08/Sep/2010:07:29:55 -0700] "GET /Page/Z6_OGFLMKG108IGF0IANFDTU130G6/Site_Analytics HTTP/1.1" 200 -1 "" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8" "portalOpenFlyout=;LtpaToken2=8iow+eV5jr4tY37uwNk17oI4eRj4Cnagg0KYwv/wTMTYPW542e60q1CKgoA5f1ACTlJxdOk7FRTVZt9J7AmXBRRcJLTTwA3Il+yTvabu1m7n6Ujs06LpGZD41f4YOxPW2mdIrMvm/qLDFHlPi1aDcX1beM34IEExVFFQjo53wnC+OiE5SOwGrOxrSSGuIwpUVMXRL7ROJT47yDdppr3tvcyrr5E5TarKw/qmkLQayfhrPZTvNf6FkgqtV/sDtqxckV5wi5mgDcdXMT6Bixzb7nEHVjyhZg6sWu523UZ2vwlbA/n0jqiyfDythfIdGbtpVhk6jEAGspU6L6ll4kj5yZsFltNe+Gx7ELsOILqx4AucUQsH3frSsgr3YvwRqaPZiDBsiJ1+zpHMkyOkIBM/gW2QvvGEvO9IUd5f20dqhUctbdi+sKPnWnHxkABWP7r15y5pVfFGijFuNUM9uvAEcZ1tr/tRq4C43iHCE/pUj20h3eE3ZYRVrNTxSzJd+tC9jssW4Vx/pLye7T2HDe5burHk/QavV6pTw5o5Xdl7e/1IcoH4n2VZgonqQc4dZm7uwxT4cWRKThoWQbfkOa4FIiZq+zvv2jZFOBq9dVeJWObVTG1AWLL0peG1XppJ6VY4FVz/MFiLbw6pKMWzHEr5d4x5BtvatV03k0Ri6ouIBeLbw8i7qDObWWsIlA7j36TV;portalFlyoutIsOpen=;JSESSIONID=0000oKrwgT_5eVylkyN1YmaDnEP:-1"


You can configure the WP_SiteAnalyzerLogService and add SiteAnalyzerFormatter.cookies property with value equal to names of the cookies that should be logged in the log, then only that cookie gets logged. If you dont configure this property then by default it writes all the cookies in the log. On my local i configured this property to log only JSESSIONID cookie by configuring it like this



After making this change restart your server and now you will notice that the logs are cleaner. This is how a typical log entry look like


localhost.localdomain - wasadmin [09/Sep/2010:06:59:53 -0700] "GET /Portlet/Z5_OGFLMKG108IGF0IANFDTU13085/Site_Analytics_portlet?PortletPID=Z5_OGFLMKG108IGF0IANFDTU13085&PortletMode=view&PortletState=normal HTTP/1.1" 200 -1 "http://localhost/Page/Z6_OGFLMKG108IGF0IANFDTU130G6/Site_Analytics" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9" "JSESSIONID=0000iLVC75NHzLRaJr-0mNVA6T5:-1"



1 comment: