SharePoint Logger Proxy in sandbox solution

Nov 29, 2011 at 6:18 AM

Hi,

I have deployed the sandbox logger proxy solution in SharePoint and the following assemblies are added to the GAC successfully:

 

Microsoft.Practices.ServiceLocation

Microsoft.Practices.SharePoint.Common

Microsoft.Practices.SharePoint.Common.LoggerProxy

Microsoft.Practices.SharePoint.Common.XmlSerializers

 

And added the following code to Trace in logs:

IServiceLocator serviceLocator = SharePointServiceLocator.GetCurrent();           

ILogger logger = serviceLocator.GetInstance<ILogger>();                       

logger.TraceToDeveloper("Visual Webpart1 Started", SandboxTraceSeverity.Medium);

 

But on executing the sandbox solution, no traces are found. On debugging, always proxyCheckerIsInstalled=0 in ProxyInstalled() method.

Whether I'm missing some more configuration?

Coordinator
Nov 29, 2011 at 11:27 AM

Did you check the level configured in central admin to make sure it was medium or lower for the default category?  The default category if you do not specify one is  SharePoint Guidance and the log level for that category should be at least medium.  Also consider defining your own category.  if you log events, you will need to register the categories prior to use on each WFE.  The guide describes how to do that (writing to the event log causes a category to added to the registry if it doesn't already exist, which is a security issue - therefore it needs to be registered prior to use from a higher privileged process) - this includes the SharePoint Guidance category.