MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Central Admin Web object and SPDiagnosticsServiceBase

  Date: May 29    Category: MOSS    Views: 1103

It may not have have anyting to do with the SPDiagnosticsServiceBase,
but I am putting entire scenario here for clarity.

I want to create a Custom Logger using SPDiagnosticsServiceBase class. I
also want to store the "Categories" in a custom list, so that the
categories are not hard coded and adding, removing category just require
re-registering the service.

I created the list, added few items in it and register the service using
a Feature Receiver. My Area and Categories start appearing on the
diagnostic settings page and every thing looked great till here.

Now when I change the logging level for my Custom Area, the diagnostic
settings page crashed.

I was trying to access category list from ProvideAreas() method. I found
out that the SPWeb object reference to Central Administration site has
some funky behaviour. Alot of properties of SPWeb throws an exception
(even AllowunsafeUpdates). However these properties were available for
the Web reference obtained from SPFeatureReceiverProperties.Parent.

When I try to access the list using web.Lists.tryGetList("Category") it
does return me a reference, but accessing list items using
categoryList.Items throws an exception, however list.ItemsCount is
correctly shown.

I appreciate if anyone point me to a blog or something where I can know
more about the SPWeb reference for Central Admin site or guide me to a
better implementation of what I am trying to accomplish? I am willing to
share the code.



3 Answers Found

Answer #1    Answered On: May 29    

The implementation doesn't need to be a list, it can be a document library as
long as I can log who viewed the item.

I was thinking about creating an Http Handler, can any one me give me a better

Answer #2    Answered On: May 29    

You don't need an HTTP handler. Just turn on the Auditing Information
Management Policy for the document library and it will tell you who downloaded
the files.

Answer #3    Answered On: May 29    

This application is a front end for a non-sharepoint business application and
these documents are shared between the two. I wanted to log the information
in database.

Is this possible by developing a custom policy ? OR Is it possible to
programmatically access Information policy data, then I can have a job putting
this information back to database ?

Didn't find what you were looking for? Find more on Central Admin Web object and SPDiagnosticsServiceBase Or get search suggestion and latest updates.