I'm really sorry it has taken me so long to post my feedback - and it
isn't even that special. I've just been very busy. Anyway, here
goes:
Elmah works pretty much out of the box with SharePoint 2007. The main
thing that took me some time to work out was that the httpmodules
section in web.config had to go in before all the other modules - the
subject of my original post here.
The other thing I did was to place the Elmah dll in the GAC (which
requires it to be signed). This means that references to Elmah in the
web.config file need to use the fully qualified name. In my case, the
entry for the httpmodule was:
<add name="ElmahErrorLog" type="Elmah.ErrorLogModule, Elmah,
Version=1.0.9414.0, Culture=neutral, PublicKeyToken=512382219eb3b98f" /
Without doing this, I encountered issues with permissions. I think
there are other ways of solving this - by modifying the trust level
used by SharePoint for example - I found using the GAC to be the best
solution for me though.
What I found really usefull was that all the errors from each of my
front end web servers were logged together. I was then able to
install the Elmah handler for viewing the errors on another webserver
which is part of the farm but not accesible to the public (it hosts
the central administrative site for sharepoint). From this "safe" web
server, I was able to see the error logs for the whole farm.
Another thing that I've been quite pleased with - and this is
SharePoint specific - is that I was able to make a small change in the
ELMAH code which allowed me to set a custom error page for my web
application. This may seem insignificant - everyone knows you can set
a custom error page in the web.config. Well, try doing that with
SharePoint. Microsoft for some reason has built into the logic of
sharepoint, a reference to one single error page that all Sharepoint
applications on a given web server share. This is a real pain but
with the following lines added to the "OnError" method in
ErrorLogModule.cs in the Elmah source code, this was solved:
HttpContext.Current.Server.ClearError();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Redirect("/_layouts/custom/
error_portal.html");
Maybe there is a smarter solution but this worked for me and was very
easy to implement.
There is a similar issue in sharepoint with unauthorised access page
in Sharepoint. There is just one that is shared by all the
applications. It would be interesting if there is some way in which
Elmah could help in intercepting an unauthorised access and
redirecting to a custom error page.
On Apr 11, 9:12 am, Atif Aziz <Atif.A...@skybow.com> wrote:
> > over the
> > next few days as I learn more aboutSharepointand elmah, I will try
> > to put what I have learnt together to share.
> Awesome and looking forward. I get asked about SPS and ELMAH occasionally but since I have very little experience with SPS, I usually shy away from the questions. I'd be great if you could share your in-field experience from the trenches. :) It might be the springboard for someone else to jump in as well with their wisdom. By the way, don't let the formatting get in your way. Even if you write up something in HTML or Word, I can quickly convert it to wiki and post it on the ELMAH project site.
> -----Original Message-----
> From: elmah@googlegroups.com [mailto:elmah@googlegroups.com] On Behalf Of ajam
> Sent: Friday, April 11, 2008 9:06 AM
> To: ELMAH
> Subject: [ELMAH] Re:sharepointand elmah
> Wow, you are quick at relying to this forum.
> You are right. The least I can do to say thank you is to share my
> experience. I cannot promise when I'll be able to do it, but over the
> next few days as I learn more aboutSharepointand elmah, I will try
> to put what I have learnt together to share.
> Regards,
> Ed
> On Apr 10, 6:09 pm, Atif Aziz <Atif.A...@skybow.com> wrote:
> > Thanks for sharing this, Edward. Dare I suggest...Why not put your findings into a more structured wiki article that we can then post over athttp://code.google.com/p/elmah/w/list?
> > -----Original Message-----
> > From: elmah@googlegroups.com [mailto:elmah@googlegroups.com] On Behalf Of ajam
> > Sent: Thursday, April 10, 2008 6:02 PM
> > To: ELMAH
> > Subject: [ELMAH]sharepointand elmah
> > Hello,
> > I have spent most of the day trying to get elmah working with
> >sharepoint2007 without luck. The handler has been successfully set
> > up so that I can reach the elmah.axd page.
> > I have followed all the instructions but errors insharepointare not
> > getting logged to elmah. It seems to me thatsharepointis not
> > passing the error to the httpapplication error event:(
> > -----------
> > Good news - literally as I was typing this post, I decided to try
> > changing the order of the httpmodule declaration in web.config. I put
> > the elmah module before the others and voila!!! - it works.
> > I'll leave this post just in case it helps someone.
> > Thanks for a great product by the way Atif !!!! I'm surprised there
> > isn't more discussion of it in the context ofsharepoint.- Hide quoted text -
> > - Show quoted text -- Hide quoted text -
> - Show quoted text -