I have done some minor fixes to a timerjob, which writes to ULS after every step and error, but, for some reason after last deployment, it fails and is most confusing to me - doesn't write to ULS (even though from progress it is clearly seen that it should)
2 Answers
Try these lines to write on the Log file:
SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("Your Category", TraceSeverity.High, EventSeverity.Information), TraceSeverity.High, "My log text");
-
Used practically same line, just with other constructor, in past it worked, now it doesn't– ViliusCommented Aug 19, 2014 at 9:51
-
-
It should looking from progress, but problem is that in local machine it works fine, but in production machine it has this problem, so I can't use debugging either– ViliusCommented Aug 19, 2014 at 9:54
-
try to put the lines after the Execute method declaration. (and after deployment remember to restart SP Timer Service)– Nk SPCommented Aug 19, 2014 at 9:55
The problem is that the farm was on few machines, so the one on which the project was deployed, wasn't the one on which it worked
-
Take a look of SPJobLockType: msdn.microsoft.com/en-us/library/…– Nk SPCommented Aug 19, 2014 at 10:06