I am using LogToOperations method provided by SGL for logging.
My requrement was that the event should be logged under custom event source.
I have used following code to set the custome event source name for SGL Logger as suggested in the link for SGL
First I created the "My Custom Event Source" evenet source
string eventSourceKey =
serviceLocator = SharePointServiceLocator.GetCurrentFarm();
configManager = serviceLocator.GetInstance<IConfigManager>();
IPropertyBag propertyBag = configManager.GetPropertyBag(ConfigLevel.CurrentSPFarm);
configManager.SetInPropertyBageventSourceKey , "My Custom Event Source", propertyBag);
But evenet was created in the eventViewer but the source was "Patterns and Practices".
I changed the eventSourceKey to
Microsoft.Practices.SPG.Common.EventSourceName as mentioned in the link
But that also didnot work.
So its a bug or what?
So what excately has to be done to use Custom Evenet Source Name for LogToOperations methods.