@@ -329,8 +329,11 @@ this SDK also ships a "self-diagnostics feature", which helps troubleshooting.
329
329
When enabled, internal events generated by OpenTelemetry will be written to a
330
330
log file.
331
331
332
- The self-diagnostics feature can be enabled/disabled while the process
333
- is running.
332
+ The self-diagnostics feature can be enabled/changed/disabled while the process
333
+ is running. The SDK will attempt to read the configuration file every ` 10 ` seconds
334
+ in non-exclusive read-only mode. The SDK will create or overwrite a file
335
+ with new logs according to the configuration. This file will not exceed the
336
+ configured max size and will be overwritten in a circular way.
334
337
335
338
To enable self-diagnostics, go to the
336
339
[ current working directory] ( https://en.wikipedia.org/wiki/Working_directory ) of
@@ -362,7 +365,10 @@ You can also find the exact directory by calling these methods from your code.
362
365
can be an absolute path or a relative path to the current directory.
363
366
364
367
2 . ` FileSize ` is a positive integer, which specifies the log file size in
365
- [ KiB] ( https://en.wikipedia.org/wiki/Kibibyte ) .
368
+ [ KiB] ( https://en.wikipedia.org/wiki/Kibibyte ) . This value must be between 1 MiB
369
+ and 128 MiB (inclusive), or it will be rounded to the closest upper or lower
370
+ limit. The log file will never exceed this configured size, and will be
371
+ overwritten in a circular way.
366
372
367
373
3 . ` LogLevel ` is the lowest level of the events to be captured. It has to be one
368
374
of the
@@ -379,19 +385,19 @@ A `FileSize`-KiB log file named as `ExecutableName.ProcessId.log` (e.g.
379
385
` foobar.exe.12345.log ` ) will be generated at the specified directory
380
386
` LogDirectory ` , into which logs are written to.
381
387
382
- The SDK will attempt to open the configuration file in non-exclusive read-only
383
- mode, read the file and parse it as the configuration file every 10 seconds. If
384
- the SDK fails to parse the ` LogDirectory ` , ` FileSize ` or ` LogLevel ` fields as
388
+ If the SDK fails to parse the ` LogDirectory ` , ` FileSize ` or ` LogLevel ` fields as
385
389
the specified format, the configuration file will be treated as invalid and no
386
- log file would be generated. Otherwise, it will create or overwrite the log file
387
- as described above.
388
-
389
- Note that the ` FileSize ` has to be between 1 MiB and 128 MiB (inclusive), or it
390
- will be rounded to the closest upper or lower limit. When the ` LogDirectory ` or
391
- ` FileSize ` is found to be changed, the SDK will create or overwrite a file with
392
- new logs according to the new configuration. The configuration file has to be no
393
- more than 4 KiB. In case the file is larger than 4 KiB, only the first 4 KiB of
394
- content will be read.
390
+ log file would be generated.
391
+
392
+ When the ` LogDirectory ` or ` FileSize ` is found to be changed, the SDK will create
393
+ or overwrite a file with new logs according to the new configuration. The
394
+ configuration file has to be no more than 4 KiB. In case the file is larger than
395
+ 4 KiB, only the first 4 KiB of content will be read.
396
+
397
+ The log file might not be a proper text file format to achieve the goal of having
398
+ minimal overhead and bounded resource usage: it may have trailing ` NUL ` s if log
399
+ text is less than configured size; once write operation reaches the end, it will
400
+ start from beginning and overwrite existing text.
395
401
396
402
## References
397
403
0 commit comments