1

I've found that SharePoint Foundation 2013 has some problems with Logging to ULS. Whenever I try to case an exception on the website using GUI or I want to write a message to ULS from a webpart nothing gets logged to ULS.

How to reproduce without any custom code:

  • Go to any list
  • go to any list item
  • replace the ID in the url to one that does not exist
  • you'll get an error:

enter image description here

I've managed to reproduce this problem on all Foundation servers I could get my hads not. This includes:

  • SharePoint 2013 Foundation SP1 (rereleased)
  • SharePoint 2013 Foundation March 2015 CU: 15.0.4701.1000
  • SharePoint 2013 Foundation April 2015 CU: 15.0.4711.1000

Additional info

  • I can write Logs to ULS from Console apps or Powershell with no problems
  • there are many useless logs from w3wp.exe and OWSTIMER.exe in ULS, but those are not exceptions, just some infromational spam
  • Windows logs or ULS do not contain any hints as to what is going on. I've looked very carefully.
  • clearing SharePoint cache does not help
  • running SharePoint wizard does not help
  • app pool account is a member Performance Monitor Users
  • we have one farm with 2 WFE where only one of the servers gets logs written properly
  • the problem has nothing to to with logging categories because this problem occures even when I causing it manually via standard OOB GUI (mentioned above).

There is a similar(but not duplicate) question with my bounty. You can answer there as well to get it.

0

Here is an answer to this mystery. After almost 9 months of utter misery we finally found that the source of the problem was in global.asax. More specifically, we replace SpHttpApplication with our custom class that inherits from SpHttpApplication.

Standard SharePoint's global.asax looks like this:

<%@ Application Language="C#" Inherits="Microsoft.SharePoint.ApplicationRuntime.SPHttpApplication" %>

We have modified it (with an Web application feature) to look like so:

<%@ Assembly Name="Microsoft.SharePoint" %>
<%@ Assembly Name="CustomDll"%>
<%@ Application Language="C#" Inherits="CustomDll.CustomSpHttpApplication" %>

So, basically, whenever we replace standard SpHttpApplication with a custom implementation on SharePoint 2013 Foundation we get no logs written via w3wp. Weirdly enough, it does not affect SharePoint 2013 Standard/Enterprise.

I was unable to dig deeper into the exact reason for this behavior since there are no errors anywhere present on the server while logging. It must be somewhere deep in COM-objects where some dark magic happens that prevents the logs from being written.

Update: I've found out that more specifically, problem occurs when using one of those methods:

SPUtility.GetCurrentGenericSetupPath(xmlKernelConfigurationPath)

SPUtility.GetVersionedGenericSetupPath(xmlKernelConfigurationPath, 15)

Looks like these methods do not cause any exceptions, but as a consequence, logs do not get written. I know, it sounds incredible, but this is true. I'm still trying to dig deeper.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.