Troubleshooting logging improvement
Published Mar 25 2019 03:50 PM 1,882 Views
Copper Contributor
First published on MSDN on Jun 02, 2015
Troubleshooting logging improvement

In the SQL Server 2016, we did logging improvement to improve the debug ability and make the troubleshooting easier.

1.       Tracing setting in the web.config



<sources>



<!-- Adjust the switch value to control the types of messages that should be logged.



http://msdn.microsoft.com/en-us/library/system.diagnostics.sourcelevels



Use the a switchValue of Verbose to generate a full log. Please be aware that



the trace file can get quite large very quickly -->



<source name="MDS" switchType="System.Diagnostics.SourceSwitch" switchValue="Warning, ActivityTracing">



<listeners>



<!-- Set a directory path where the service account you chose while setting up Master Data Services has read and write privileges.



Default path is Logs in WebApplication folder, for example C:\Program Files\Microsoft SQL Server\130\Master Data Services\WebApplication



New log file will be created everyday or every 10 mb.



When directory size hits the 200mb limitation, the oldest file will be deleted.-->



<add name="FileTraceListener"



type="Microsoft.MasterDataServices.Core.Logging.FileTraceListener, Microsoft.MasterDataServices.Core"



initializeData="DirectoryPath = Logs; FileSizeInMb = 10; MaxDirectorySizeInMb = 200"/>



<remove name="Default"/>



</listeners>



</source>



</sources>



We have a new section in the web.config for tracing setting.



By default,



a.       Tracing is enabled for Warning and below level, plus ActivityTracing.



b.      The Logs are saved in the Logs folder under the WebApplication folder. For example, C:\Program Files\Microsoft SQL Server\130\Master Data Services\WebApplication



c.       The file file will be created for each day or every 10 mb



d.      Maximum usage on Logs folder will be 200mb, the oldest log will be deleted.



e.      The log format is CSV.



2.       Log format





Time

When the trace entry happens

CorrelationId

One correlation id is assigned for each request. The all the traced trigged by this request will share the same correlation id.

Operation

The request operation name. If the request is web ui request, the operation name is the url. If request is API request, the operation name is the service name.

Level

The level of this trace entry.

Message

The message body of the trace





The log is CSV format and can be opened in Microsoft Excel or other tools for filtering.





3.       Correlation Id



Each request will be assign a correlation id, the all trace trigger by this request will share the same id.



When an error happens, in the UI, the correlation id will be shown in the error message.





Web UI:







Excel Addin UI:







t.com/en-us/library/system.diagnostics.sourcelevels

Use the a switchValue of Verbose to generate a full log. Please be aware that

the trace file can get quite large very quickly -->

<source name="MDS" switchType="System.Diagnostics.SourceSwitch" switchValue="Warning, ActivityTracing">

<listeners>

<!-- Set a directory path where the service account you chose while setting up Master Data Services has read and write privileges.

Default path is Logs in WebApplication folder, for example C:\Program Files\Microsoft SQL Server\130\Master Data Services\WebApplication

New log file will be created everyday or every 10 mb.

When directory size hits the 200mb limitation, the oldest file will be deleted.-->

<add name="FileTraceListener"

type="Microsoft.MasterDataServices.Core.Logging.FileTraceListener, Microsoft.MasterDataServices.Core"

initializeData="DirectoryPath = Logs; FileSizeInMb = 10; MaxDirectorySizeInMb = 200"/>

<remove name="Default"/>

</listeners>

</source>

</sources>

We have a new section in the web.config for tracing setting.

By default,

a. Tracing is enabled for Warning and below level, plus ActivityTracing.

b. The Logs are saved in the Logs folder under the WebApplication folder. For example, C:\Program Files\Microsoft SQL Server\130\Master Data Services\WebApplication

c. The file file will be created for each day or every 10 mb

d. Maximum usage on Logs folder will be 200mb, the oldest log will be deleted.

e. The log format is CSV.

2. Log format



Time

When the trace entry happens

CorrelationId

One correlation id is assigned for each request. The all the traced trigged by this request will share the same correlation id.

Operation

The request operation name. If the request is web ui request, the operation name is the url. If request is API request, the operation name is the service name.

Level

The level of this trace entry.

Message

The message body of the trace



The log is CSV format and can be opened in Microsoft Excel or other tools for filtering.

3. Correlation Id

Each request will be assign a correlation id, the all trace trigger by this request will share the same id.

When an error happens, in the UI, the correlation id will be shown in the error message.

Web UI:



Excel Addin UI:



For more information:

Tracing (Master Data Services)

Version history
Last update:
‎Mar 25 2019 03:50 PM
Updated by: