Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-Diagnostics: include datetimestamp in filename #2325

Merged
merged 6 commits into from
Jul 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
come review comments
TimothyMothra committed Jul 9, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 22c1dfceb09a75ff3f8c90665f4277a0afd397fb
Original file line number Diff line number Diff line change
@@ -83,8 +83,6 @@ private static string ParseLogMessage(string logLine)

private static byte[] ReadFile(string filePath, int byteCount)
{
//var outputFileName = Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName) + "." + Process.GetCurrentProcess().Id + ".log";
//var outputFilePath = Path.Combine(".", outputFileName);
using (var file = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
byte[] actualBytes = new byte[byteCount];
4 changes: 3 additions & 1 deletion troubleshooting/ETW/Readme.md
Original file line number Diff line number Diff line change
@@ -150,13 +150,15 @@ Example:

#### Configuration Parameters

A `FileSize`-KiB log file named as `ExecutableName.ProcessId.log` (e.g. `foobar.exe.12345.log`) will be generated at the specified directory `LogDirectory`.
A `FileSize`-KiB log file named as `YearMonthDay-HourMinuteSecond.ExecutableName.ProcessId.log` (e.g. `20010101-120000.foobar.exe.12345.log`) will be generated at the specified directory `LogDirectory`.
The file starts with the `DateTime.UtcNow` timestamp of when the file was created.

1. `LogDirectory` is the directory where the output log file will be stored.
It can be an absolute path or a relative path to the current directory.

2. `FileSize` is a positive integer, which specifies the log file size in [KiB](https://en.wikipedia.org/wiki/Kibibyte).
This value must be between 1 MiB and 128 MiB (inclusive), or it will be rounded to the closest upper or lower limit.
The log file will never exceed this configured size, and will be curcularly rewriten.

3. `LogLevel` is the lowest level of the events to be captured.
This value must match one of the [fields](https://docs.microsoft.com/dotnet/api/system.diagnostics.tracing.eventlevel#fields) of the `EventLevel` enum.