What triggers the SSRS to generate a log file or modify a current one?
-
25-02-2021 - |
Question
When running a trace on my new SSRS Reporting Services 2016, after troubleshooting some problems related to migrating from SSRS 2008, I find the following pattern running continuously:
Here is the continuously run script:
--========================================================
--the script that is run over and over
-- by the SSRS service
--========================================================
declare @BatchID uniqueidentifier
set @BatchID = NEWID()
UPDATE [Event] WITH (TABLOCKX)
SET [BatchID] = @BatchID,
[ProcessStart] = GETUTCDATE(),
[ProcessHeartbeat] = GETUTCDATE()
FROM (
SELECT TOP 4 [EventID]
FROM [Event] WITH (TABLOCKX)
WHERE [ProcessStart] is NULL
ORDER BY [TimeEntered]
) AS t1
WHERE [Event].[EventID] = t1.[EventID]
select top 4
E.[EventID],
E.[EventType],
E.[EventData]
from
[Event] E WITH (TABLOCKX)
where
[BatchID] = @BatchID
ORDER BY [TimeEntered]
set @BatchID = newid()
UPDATE [Notifications] WITH (TABLOCKX)
SET [BatchID] = @BatchID,
[ProcessStart] = GETUTCDATE(),
[ProcessHeartbeat] = GETUTCDATE()
FROM (
SELECT TOP 4 [NotificationID]
FROM [Notifications] WITH (TABLOCKX)
WHERE ProcessStart is NULL and
( ProcessAfter is NULL
or ProcessAfter < GETUTCDATE())
ORDER BY [NotificationEntered]
) AS t1
WHERE [Notifications].[NotificationID]
= t1.[NotificationID]
select top 4
-- Notification data
N.[NotificationID],
N.[SubscriptionID],
N.[ActivationID],
N.[ReportID],
N.[SnapShotDate],
N.[DeliveryExtension],
N.[ExtensionSettings],
N.[Locale],
N.[Parameters],
N.[SubscriptionLastRunTime],
N.[ProcessStart],
N.[NotificationEntered],
N.[Attempt],
N.[IsDataDriven],
SUSER_SNAME(Owner.[Sid]),
Owner.[UserName],
-- Report Data
O.[Path],
N.[ReportZone],
O.[Type],
SD.NtSecDescPrimary,
N.[Version],
Owner.[AuthType],
SR.[SubscriptionResult]
from
[Notifications] N with (TABLOCKX)
inner join [Catalog] O
on O.[ItemID] = N.[ReportID]
inner join [Users] Owner
on N.SubscriptionOwnerID = Owner.UserID
left outer join [SecData] SD
on O.[PolicyID] = SD.[PolicyID]
AND SD.AuthType = Owner.AuthType
left outer join [SubscriptionResults] SR
on N.[SubscriptionID] = SR.[SubscriptionID]
AND CHECKSUM(convert(nvarchar(max),N.[ExtensionSettings]))
= SR.[ExtensionSettingsHash]
where
N.[BatchID] = @BatchID
ORDER BY [NotificationEntered]
In the meantime SSRS generated another log. There is nothing significative in the log, it is all information only, as you can see on the partial view picture below:
All seems normal. So the question is:
What triggers the SSRS to generate a report - other than an exception or error somewhere?
Where in SSRS can I go to have a look\modify this behaviour if possible?
I have checked the config files: You should backup these alongside the report server databases:
- Rsreportserver.config
- Rssvrpolicy.config
- Rsmgrpolicy.config
- Reportingservicesservice.exe.config
- Web.config for the Report Server ASP.NET application
- Machine.config for ASP.NET
This is the log in question:
The modified date of the file has just changed and I noticed SSRS added information to this same file.
Solution
The log in question I believe is
Report Server Service Trace Log and it turned ON by default
I figured this by checking where the log is stored in the question.
Trace log behavior is managed in the configuration file ReportingServicesService.exe.config. The configuration file is found in the following folder path:
\Program Files\Microsoft SQL Server\MSRS13.\Reporting Services\ReportServer\bin.
if you want to disable this logging you can do the below.
DefaultTraceSwitch Specifies the level of information that is reported to the ReportServerService trace log. Each level includes the information reported by all lower-numbered levels. Disabling tracing is not recommended. Valid values are:
0= Disables tracing. The ReportServerService log file is enabled by default. To turn it off, set trace level to 0.
You can tweak this value based on your requirements.
0= Disables tracing. The ReportServerService log file is enabled by default.
To turn it off, set trace level to 0.
1= Exceptions and restarts
2= Exceptions, restarts, warnings
3= Exceptions, restarts, warnings, status messages (default)
4= Verbose mode
More info here
OTHER TIPS
SSRS creates a row in the dbo.Event table whenever it queues up a report. It appears all that you're observing is SSRS continuously checking to see if anything is queued so that it can be executed.