I am trying to implement some logging in my webpart. I implemented a Custom trace provider implementation which writes Log messages into the 12 hive logs as has been described here:
http://msdn.microsoft.com/en-us/library/aa979522.aspx
I have wrapped the above code into a dll called logging.DLL.
I am referencing this DLL in my webpart.
I am calling the RegisterTraceProvider in the constructor using elevated privileges.
I have declared the Logging DLL as a safe control in the manifest.xml.
But When i try to add the webpart to the page, I get a security exception with message "Request failed." THis error is thrown in the constructor when it tries to call the RegisterTraceProvider method.
Am I missing something here? How can I get this logging to work?
Edit:Both my logging DLL and my webpart DLL are in the GAC.