Solved

SharePoint 2010: Errors not showing up in diagnostic log

Posted on 2011-09-15
16
587 Views
Last Modified: 2012-05-12
I am having an issue with the error logging in our development SharePoint 2010 box. This is a new install. When working on an application page, I had an error and went to the logs. Pretty much every other thing in the world is in the logs except for my error(s). I looked for the correlation ID and time and nada.

I've followed tutorials on how to configure the diagnostic logging. We have a stanging machine that I was working on until the dev machine was up and the logging worked fine there. I used that as an example and set the SharePoint Foundation and SharePoint Server categories to Error and Medium (I've even set them both to Verbose) with no result.

Anyone else have an issue with this?
0
Comment
Question by:mannyms
  • 8
  • 5
  • 3
16 Comments
 
LVL 14

Expert Comment

by:abhitrig
ID: 36549157
Few pointers worth considering:
-Check the log path in the CA and make user its pointing to the correct location (where you are looking for the files)
-If you are using the ULS viewer, try to open the viewer first and the repeat the actions that generate the error. By default ULS viewer only shows the error since it was opened (unless you open a file explicitly)
-Try searching for the correlation token by opening the file in notepad and the search for the partial guid....so remove the first and last section of the guid. I once had this weird case where it was not searching for the complete guid but the partial guid search was fine

0
 

Author Comment

by:mannyms
ID: 36549531
Thanks for your response. The diagnostic logging path is set to '%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\14\LOGS\'. I can tell that this is the right path because when I set it to verbose, I can see a LOT more data arriving into the log. Good idea on the partial GUID search but I tried all permutations of the GUID tokens and nothing.

This is so weird. I would just do a comparison of of Staging box and my Dev box but I don't even know what to compare.

I could also do explicit logging in my code, but having to do that for every conceivable point of failure will get tiring.
0
 
LVL 15

Expert Comment

by:liebrand
ID: 36550056
Try restarting the "SharePoint 2010 Tracing" service.  I have seen that cause this type of issue before.
0
 
LVL 14

Expert Comment

by:abhitrig
ID: 36550160
I agree that this does not make sense.

Please try the below:
- Turn on the ULSviewer (i hope you are not not using notepad, etc) and the repeat the steps that are causing the error. do you see any activity in the ULS viewer, like requests opened to your web, etc? you can also note the time and look in that range
-Try turning on the Developer dashboard. It should give you more details on the error page.

And just to be sure, this page where you are getting this error is an out-of-the-box SP page? or a webpart page with a webpart, etc?
0
 

Author Comment

by:mannyms
ID: 36551101
Liebrand: I restarted the tracing service with no result.

Abhitriq: As much as I love my Notepad++, I'm not using that. ;-) I am using the ULS viewer. But I do not see the system logging such things as opening my web, accessing the particular page, etc. It also seems that the developer dashboard doesn't come up if there is a fatal error.
0
 

Author Comment

by:mannyms
ID: 36551207
Also, this is not an out-of-the box page. This is an application page that I have created.
0
 
LVL 15

Expert Comment

by:liebrand
ID: 36551370
What error are you getting?  Perhaps you are getting an error at a layer before SharePoint and therefore it is not going to log it.
0
 

Author Comment

by:mannyms
ID: 36551379
I'm getting a correlation ID and timestamp. Does that sound like it's the SharePoint layer? But of course I can't see what exactly the error is.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:mannyms
ID: 36551615
I activated the Developer Dashboard. I can see the error (of a well-made page) in the dashboard, but not in the logs. By well-made, I mean a page that doesn't have an errors that would cause the page to not even load. Those is the case, apparently, with my earlier attempts. I just created a page that simply has a button and when clicked throws a new error (see attachment). But that error is still not logged, nor does the log even say that my page is being called.   Screenshot of error in dashboard
0
 
LVL 14

Expert Comment

by:abhitrig
ID: 36551749
So you are trying to log your "custom error" to the ULS logs...right? If that is the case i dont think SP will automatically write it for you. You will have to write your custom errors on your own.
http://blogs.msdn.com/b/sowmyancs/archive/2010/04/17/how-to-write-custom-logs-into-uls-logs.aspx

SP traps any "SharePoint related errors", errors from the native pages and throw the correlation id and then logs the error.
0
 

Author Comment

by:mannyms
ID: 36551759
Back on my staging server I used these same application page projects, and if there was an error it would write them to the logs (without my needing to write methods to do so).
0
 
LVL 14

Expert Comment

by:abhitrig
ID: 36551779
That depends on the kind of the error. If its related to native SP issues, like security validation, masterpage association, etc...they will get logged to the ULS logs.
The application pages are derived from ApplicationsLayoutsBase, so any errors that get caught by the SP base platform will be handled by SP. Any custom errors, say some business logic, etc will have to be handled by your code explicitly.
0
 
LVL 15

Expert Comment

by:liebrand
ID: 36551791
Could you make your source available for this test page?
0
 

Author Comment

by:mannyms
ID: 36551824
I have attached a piece of code. It's using LINQ-to-SQL classes to connect to a database. After putting in the try-catch and using the SPDiagnosticsService class, it doesn't crash (with correlationID) anymore but it still doesn't go into the log.  
try
            {
                NBICPortalDataContext ndc = new NBICPortalDataContext("data source=NB-UAT-DB-01;initial catalog=NBIC_Portal;persist security info=False;user id=sql_portal;password=PortalService!;packet size=4096;");
                var collAgencies = ndc.sp_Agencies_Adresses_GetAllActiveMaster();
                Label1.Text = collAgencies.Count().ToString();
            } catch (Exception ex) 
            {
                SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("AppPage", TraceSeverity.Medium, EventSeverity.Error), TraceSeverity.Unexpected, ex.Message, ex.StackTrace);
            }

Open in new window

0
 
LVL 14

Accepted Solution

by:
abhitrig earned 500 total points
ID: 36551852
Hmmm... This looks goofy. Can you ensure that your SP webapplication AppPool account is part of the "Performance Log Users" group.
0
 

Author Closing Comment

by:mannyms
ID: 36552011
After much back-and-forth, I checked the Performance Log Users group and it was EMPTY! I put in my AppPool service account and farm account into that group and also I had to assign the "Log on as a batch job" user right to the Performance Log Users group.

Thank you!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now