Solved

SharePoint 2010: Errors not showing up in diagnostic log

Posted on 2011-09-15
16
591 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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
 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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