We have developed a timer job for SharePoint 2013 in Visual Studio 2012. It is scheduled to be running between 7 AM to 7:15 AM. We have deployed the timer job using PowerShell. In code we have added PortalLog.LogString
to log messages in SharePoint error logs at the beginning of the timers execute method.
Under Site Collection we can see that it is deployed and activated. The scope of the timer job is set to Site in VS. We can see the timer job which is deployed in the review job definitions in central admin. But, cannot see it in scheduled jobs. When we go to edit the timer job via review job definitions, and hit 'Run Now', we cannot see any messages in the error logs that we have programmed using PortalLog.LogString
.
What could be the issue?
Sorry - too long for a comment. Will edit to represent an answer later.
You have to clarify quite a few things here: "Under Site Collection we can see that it is deployed and activated" - you mean you have a site collection feature to deploy a timer job? Timer jobs are installed at farm level, hence it should be a webapp/farm feature.
PortalLog.LogString
is for internal use only: PortalLog.LogString methodDid you try debugging the timer job? As it is correctly deployed to "job definitions" and you can click Run Now everything looks good so far. You only have to attach to the
SPTimerV4
(SharePoint Timer Job) for the breakpoints to be hit in your solution.You should use different logging such as explained here: https://sharepoint.stackexchange.com/questions/55381/timerjobs-and-uls and before waiting for any logs to magically appear: Debug!