Skip to content

Commit cbdc9aa

Browse files
Merge pull request #78 from microsoft/20241115_SQLCheck_ERRORLOG
SQLCheck: ERRORLOG improvement to handle more than 10 ERRORLOG files
2 parents e936c6e + d1cf398 commit cbdc9aa

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed
0 Bytes
Binary file not shown.

SQLCheck/SQLCheck/Collectors.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,24 +3081,25 @@ public static void ProcessMSSQLServer(DataSet ds, DataRow SQLInstance, DataRow S
30813081

30823082
public static void ProcessSQLErrorlog_File(DataRow SQLServer) // must come prior to loading the certificate from the registry key
30833083
{
3084-
string baseFileName = SQLServer.GetString("ErrorLogPath");
3084+
string baseFileName = SQLServer.GetString("ErrorLogPath"); // includes the filename ERRORLOG as well as the path
30853085
if (baseFileName == "") return;
30863086
string fileName = "";
30873087
string el = ""; // the entire log
30883088
string line = ""; // a single line
30893089
bool found = false;
30903090

30913091
//
3092-
// Find the first ERRORLOG[.n] file that starts from the beginning
3092+
// Find the first ERRORLOG[.n] file that starts from the beginning - can be more than 30 files, potentially, so we'll try up to 99; break when file not found
30933093
//
30943094

30953095
try
30963096
{
3097-
for (int i = 0; i < 10; i++)
3097+
for (int i = 0; i < 99; i++)
30983098
{
30993099
fileName = $@"{baseFileName}" + ((i > 0) ? $".{i}" : "");
3100-
el = Utility.GetFileText($@"{fileName}"); // returns empty string if the file does not exist
3101-
if (el.Length > 0 && SmartString.GetStringLine(el, "Registry startup parameters") != "")
3100+
el = Utility.GetFileText($@"{fileName}"); // returns empty string if the file does not exist
3101+
if (el.Length == 0) break; // end of files if names aren't contiguous or no more files, i.e. file name not found
3102+
if (SmartString.GetStringLine(el, "Registry startup parameters") != "")
31023103
{
31033104
found = true;
31043105
break;

SQLCheck/SQLCheck/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.1435.0")]
36-
[assembly: AssemblyFileVersion("1.0.1435.0")]
35+
[assembly: AssemblyVersion("1.0.1437.0")]
36+
[assembly: AssemblyFileVersion("1.0.1437.0")]
2.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

SQL_Network_Analyzer/SQLNA/ETLFileReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public Frame Read()
346346

347347
// FrameBuffer is empty and we're not done with the trace
348348
// Spin and give the event handler time to add a few rows to the frame buffer
349-
Thread.Sleep(1); // can we remove the delay?
349+
// Thread.Sleep(1); // can we remove the delay?
350350
}
351351
}
352352

0 commit comments

Comments
 (0)