報表伺服器服務追蹤記錄Report Server Service Trace Log

Reporting ServicesReporting Services 報表伺服器追蹤記錄為 ASCII 文字檔案,包含報表伺服器服務作業的詳細資訊,包括報表伺服器 Web 服務、報表管理員及背景處理所執行的作業。The Reporting ServicesReporting Services report server trace log is an ASCII text file that contains detailed information for Report Server service operations, including operations performed by the Report Server Web service, Report Manager, and background processing. 追蹤記錄檔包括已記錄於其他記錄檔的重複資訊,加上別處所沒有的其他資訊。The trace log file includes redundant information that is recorded in other log files, plus additional information that is not otherwise available. 如果您要偵錯包含報表伺服器的應用程式,或者調查寫入事件記錄或執行記錄的特定問題,追蹤記錄資訊可能會很有用。Trace log information might be useful if you are debugging an application that includes a report server, or investigating a specific problem that was written to the event log or execution log.

注意

在先前的版本中,系統提供了多個追蹤記錄檔 (每個應用程式都有一個檔案)。In previous releases, there were multiple trace log files, one for each application. 下列檔案已過時,在 SQL Server 2008SQL Server 2008 和之後的版本中不會再建立:ReportServerWebApp_ <時間戳記 > .log、 ReportServer_ <時間戳記 > .log 和 ReportServerService_main_ <時間戳記 > 。 記錄檔。The following files are obsolete and are no longer created in SQL Server 2008SQL Server 2008 and later versions: ReportServerWebApp_<timestamp>.log, ReportServer_<timestamp>.log, and ReportServerService_main_<timestamp>.log.

本主題內容:In this topic:

報表伺服器記錄檔在何處?Where are the Report Server log files?

追蹤記錄檔為 ReportServerService_<timestamp>.log ,位於下列資料夾:The trace log files are ReportServerService_<timestamp>.log and are located in the following folder:

C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\LogFiles

系統每天都會建立追蹤記錄,從午夜過後 (當地時間) 發生的第一個項目,以及每次服務重新啟動時開始。The trace log is created daily, starting with the first entry that occurs after midnight (local time), and whenever the service is restarted. 此時間戳記是以國際標準時間 (UTC) 為基礎。The timestamp is based on Coordinated Universal Time (UTC). 此檔案採用 EN-US 格式。The file is in EN-US format. 追蹤記錄檔的預設大小上限為 32 MB,且預設會在 14 天後刪除。By default, trace logs are limited to 32 megabytes and by default they are deleted after 14 days.

觀看示範如何使用 Microsoft Power Query 檢視 Reporting ServicesReporting Services 記錄檔的短片。View a short video that demonstrates the use of Microsoft Power Query to view Reporting ServicesReporting Services log files.

檢視有關 Power Query 和 SSRS 記錄檔的影片view a video about Power Query and SSRS logs

追蹤組態設定Trace configuration settings

追蹤記錄檔的行為在組態檔 ReportingServicesrService.exe.config中管理。下列資料夾路徑中可找到組態檔:Trace log behavior is managed in the configuration file ReportingServicesrService.exe.config. The configuration file is found in the following folder path:

\Program Files\Microsoft SQL Server\MSRS12.<instance name>\Reporting Services\ReportServer\bin.\Program Files\Microsoft SQL Server\MSRS12.<instance name>\Reporting Services\ReportServer\bin.

下列範例說明 RStrace 設定的 XML 結構。The following example illustrates the XML structure of the RStrace settings. DefaultTraceSwitch 的值會決定要將哪種資訊新增到記錄。The value for DefaultTraceSwitch determines the kind of information that is added to the log. 除了 Components 屬性外,RStrace 的值在所有組態檔中都相同。Except for the Components attribute, the values for RStrace are the same across the configuration files.

<system.diagnostics>  
      <switches>  
          <add name="DefaultTraceSwitch" value="3" />  
      </switches>  
</system.diagnostics>  
<RStrace>  
      <add name="FileName" value="ReportServerService_" />  
      <add name="FileSizeLimitMb" value="32" />  
      <add name="KeepFilesForDays" value="14" />  
      <add name="Prefix" value="tid, time" />  
      <add name="TraceListeners" value="file" />  
      <add name="TraceFileMode" value="unique" />  
      <add name="Components" value="all" />  
</RStrace>  

下表提供有關各項設定的資訊。The following table provides information about each setting.

設定Setting 描述Description
RStrace 指定用於錯誤和追蹤的命名空間。Specifies namespaces used for errors and tracing.
DefaultTraceSwitch 指定報告到 ReportServerService 追蹤記錄的資訊層級。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= 停用追蹤。0= Disables tracing. ReportServerService 記錄檔是預設為啟用。The ReportServerService log file is enabled by default. 若要關閉,請將追蹤層級設定為 0。To turn it off, set trace level to 0.

1= 例外狀況和重新啟動1= Exceptions and restarts

2= 例外、重新啟動和警告2= Exceptions, restarts, warnings

3= 例外、重新啟動、警告和狀態訊息 (預設值)3= Exceptions, restarts, warnings, status messages (default)

4= 詳細資訊模式4= Verbose mode
FileNameFileName 指定記錄檔名稱的第一部分。Specifies the first part of the log file name. Prefix 所指定的值會完成名稱的其餘部分。The value specified by Prefix completes the rest of the name.
FileSizeLimitMbFileSizeLimitMb 指定追蹤記錄的大小上限。Specifies an upper limit on trace log size. 檔案大小的單位為 MB。The file is measured in megabytes. 有效值為 0 到最大整數。Valid values are 0 to a maximum integer. 預設值為 32。The default value is 32. 如果指定 0 或負數,報表伺服器會將該值視為 1。If you specify 0 or a negative number, the report server treats the value as 1.

藉由設定追蹤層級 (0 到 4) 來控制記錄的內容多寡,便可以控制檔案大小。You can control file size by setting tracing levels (0 through 4) to control how much content is recorded. 您也可以指定要追蹤的元件。You can also specify which components get traced. 如果在 14 天的到期日之前就已經到達記錄檔上限,將會以較新的項目取代較舊的項目。If the log file maximum is reached before the 14 day expiration date, older entries will be replaced with newer entries.
KeepFilesForDaysKeepFilesForDays 指定一個天數,超過此天數後,追蹤記錄檔便會被刪除。Specifies the number of days after which a trace log file will be deleted. 有效值為 0 到最大整數。Valid values are 0 to a maximum integer. 預設值為 14。The default value is 14. 如果指定 0 或負數,報表伺服器會將該值視為 1。If you specify 0 or a negative number, the report server treats the value as 1.
Prefix 指定可區別記錄檔執行個體的產生值。Specifies a generated value that distinguishes one log instance from another. 依預設,會將時間戳記附加至追蹤記錄檔名稱。By default, timestamp values are appended to trace log file names. 此值設定為 "tid, time"。This value is set to " tid, time ". 請勿修改此設定。Do not modify this setting.
TraceListenersTraceListeners 指定輸出追蹤記錄內容的目標。Specifies a target for outputting trace log content. 您可以指定多重目標,每個目標之間請以逗號隔開。You can specify multiple targets using a comma to separate each one. 有效值為:Valid values are:

DebugWindowDebugWindow

File (預設值)File (default)

StdOutStdOut
TraceFileModeTraceFileMode 指定追蹤記錄中是否要包含 24 小時內的資料。Specifies whether trace logs contain data for a 24-hour period. 每個元件每一天只能有一份追蹤記錄。You should have one unique trace log for each component on each day. 此值設定為「Unique (預設值)」。This value is set to "Unique (default)". 請勿修改此值。Do not modify this value.
Components 使用下列格式來指定要產生追蹤記錄資訊的元件以及追蹤層級:Specifies the components for which trace log information is generated and the trace level in this format:

<元件類別>:<追蹤層級><component category>:<tracelevel>

元件類別可設定為:Component catogories can be set to:
All 用於針對所有不屬於特定類別的程序,追蹤其一般報表伺服器活動。All is used to trace general report server activity for all processes that are not broken out into the specific categories.
RunningJobs 用於追蹤進行中報表或訂閱作業。RunningJobs is used to trace an in-progress report or subscription operation.
SemanticQueryEngine 用於追蹤語意查詢,語意查詢會在使用者對以模型為基礎的報表執行隨選資料瀏覽時處理。SemanticQueryEngine is used to trace a semantic query that is processed when a user performs ad hoc data exploration in a model-based report.
SemanticModelGenerator 用於追蹤模型產生。SemanticModelGenerator is used to trace model generation.
http 是用於啟用報表伺服器 HTTP 記錄檔。http is used to enable the Report Server HTTP Log file. 如需詳細資訊,請參閱< Report Server HTTP Log>。For more information, see Report Server HTTP Log.



追蹤層級的有效值包括:Trace level valid values are:

0= 停用追蹤0= Disables tracing

1= 例外狀況和重新啟動1= Exceptions and restarts

2= 例外、重新啟動和警告2= Exceptions, restarts, warnings

3= 例外、重新啟動、警告和狀態訊息 (預設值)3= Exceptions, restarts, warnings, status messages (default)

4= 詳細資訊模式4= Verbose mode

報表伺服器的預設值是:"all:3"。The default value for Report Server is: "all:3".

您可以指定全部或部分元件 (allRunningJobsSemanticQueryEngineSemanticModelGenerator)。You can specify all or some of the components (all, RunningJobs, SemanticQueryEngine, SemanticModelGenerator). 如果不要產生特定元件的資訊,可以停用該元件的追蹤 (例如 "SemanticModelGenerator:0")。If you do not want to generate information for a specific component, you can disable tracing for it (for example, "SemanticModelGenerator:0"). 請不要停用 all 的追蹤。Do not disable tracing for all.

如果您沒有將追蹤層級附加至元件,就會使用針對 DefaultTraceSwitch 所指定的值。If you do not append a trace level to the component, the value specified for DefaultTraceSwitch is used. 例如,如果指定 "all,RunningJobs,SemanticQueryEngine,SemanticModelGenerator",所有元件都會使用預設追蹤層級。For example, if you specify "all,RunningJobs,SemanticQueryEngine,SemanticModelGenerator", all components use the default trace level.

如果要檢視為每個語意查詢產生的 Transact-SQL 陳述式,您可以設定 "SemanticQueryEngine:4"。You can set "SemanticQueryEngine:4" if you want to view the Transact-SQL statements that are generated for each semantic query. Transact-SQL 陳述式就會記錄在追蹤記錄中。The Transact-SQL statements are recorded in the trace log. 下列範例說明將 Transact-SQL 陳述式加入記錄的組態設定:The following example illustrates the configuration setting that adds Transact-SQL statements to the log:

<add name="元件" value="all,SemanticQueryEngine:4" /><add name="Components" value="all,SemanticQueryEngine:4" />

新增自訂組態設定來指定傾印檔位置Adding Custom Configuration Setting to Specify a Dump File Location

您可以新增自訂設定,來設定 Windows 的 Dr. Watson for Windows 工具用於儲存傾印檔案。You can add a custom setting to set the location that the Dr. Watson for Windows tool uses to store dump files. 自訂設定為 DirectoryThe custom setting is Directory. 下列範例說明如何在 RStrace 區段中指定這個組態設定:The following example provides an illustration of how this configuration setting is specified in the RStrace section:

<add name="Directory" value="U:\logs\" />  

如需詳細資訊,請參閱 網站上的 知識庫文件 913046 MicrosoftMicrosoftFor more information, see Knowledge Base Article 913046 on the MicrosoftMicrosoft Web site.

記錄檔欄位Log File Fields

您可以在追蹤記錄中找到下列欄位:The following fields can be found in a trace log:

  • 系統資訊,包括作業系統、版本、處理器數量及記憶體。System information, including operating system, version, number of processors, and memory.

  • Reporting ServicesReporting Services 元件和版本資訊。component and version information.

  • 應用程式記錄檔的事件記錄。Events logged the Application log.

  • 報表伺服器所產生的例外狀況。Exceptions generated by the report server.

  • 報表伺服器所記錄的低資源警示。Low resource warnings logged by a report server.

  • 輸入 SOAP Envelope 和摘要輸出 SOAP Envelope。Inbound SOAP envelopes and summarized outbound SOAP envelopes.

  • HTTP 標頭、堆疊追蹤和偵錯追蹤資訊。HTTP header, stack trace, and debug trace information.

您可以檢閱追蹤記錄資訊,以便判斷是否發生報表傳遞、誰接收到報表以及嘗試傳遞了幾次。You can review trace log information to determine whether a report delivery occurred, who received the report, and how many delivery attempts were made. 追蹤記錄也會記錄報表執行活動,以及報表處理期間有作用的環境變數。Trace logs also record report execution activity and the environment variables that are in effect during report processing. 錯誤和例外狀況也會輸入到追蹤記錄中。Errors and exceptions are also entered into trace logs. 例如,您可能會發現報表逾時錯誤 (指定為 ThreadAbortExceptions 項目)。For example, you may find report time-out errors (indicated as a ThreadAbortExceptions entry).

另請參閱See Also

Reporting Services 記錄檔和來源 Reporting Services Log Files and Sources
錯誤和事件參考 (Reporting Services)Errors and Events Reference (Reporting Services)