Skip to content

Commit

Permalink
Fixed an issue and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kuqin12 committed Dec 12, 2023
1 parent e4a21df commit e470bce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion AdvLoggerPkg/AdvancedFileLogger/AdvancedFileLogger.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,14 @@ AdvancedFileLoggerEntry (
// Step 0. Check advanced file logger policy, default to enabled.

Status = GetPolicy (&gAdvancedFileLoggerPolicyGuid, NULL, (VOID *)&AdvFileLoggerPolicy, &PolicySize);
if (!EFI_ERROR (Status)) {
if (EFI_ERROR (Status)) {
// If we fail to get policy, default to enabled.
DEBUG ((DEBUG_WARN, "%a: Unable to get file logger - %r defaulting to enabled!\n", __func__, Status));
} else if (AdvFileLoggerPolicy.FileLoggerEnable == FALSE) {
DEBUG ((DEBUG_INFO, "%a: File logger disabled in policy, exiting.\n", __func__));
return EFI_SUCCESS;
} else {
DEBUG ((DEBUG_INFO, "%a: File logger enabled in policy.\n", __func__));
}

//
Expand Down
9 changes: 5 additions & 4 deletions AdvLoggerPkg/AdvancedFileLogger/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Advanced File Logger monitors for file systems mounted during boot.
When an eligible file system is detected, the log is flushed to the file system.
The log is flushed if the system is reset during POST, and at Exit Boot Services.

An eligible file system is one with a Logs directory in the root of the file system.
An eligible file system is one with a `UefiLogs` directory in the root of the file system.
If no log files are present, the Advanced File Logger will create a log index file which
contains the index of the last log file written, and nine log files each PcdAdvancedLoggerPages in size.
These files are pre allocated at one time to reduce interference with other users of the filesystem.
Expand Down Expand Up @@ -36,7 +36,7 @@ The Advanced File Logger can be configured to enforce the storing of memory logs

### Advanced file logger enlightenment

The Advanced File Logger can be set to store memory logs with a `Logs` directory in the ESP partition.
The Advanced File Logger can be set to store memory logs with a `UefiLogs` directory in the ESP partition.
Without such a directory **AND** the enforcement is not enabled, the Advanced File Logger will not store
memory logs.

Expand All @@ -58,7 +58,7 @@ Note: The above enablement, enforcement and enlightenment are in serial, the gen
if (Enable) {
if (PcdGet (PcdAdvancedFileLoggerForceEnable)) {
StoreLogs = TRUE;
} else if (DirectoryExists (L"Logs")) {
} else if (DirectoryExists (L"UefiLogs")) {
StoreLogs = TRUE;
} else {
StoreLogs = FALSE;
Expand All @@ -67,7 +67,8 @@ Note: The above enablement, enforcement and enlightenment are in serial, the gen

if (StoreLogs) {
// Store logs
StoreLogs ("Logs/Log#.txt");
// The UEFI_Index.txt file will indicate the last log file written
StoreLogs ("UefiLogs/Log#.txt");
}
```
Expand Down

0 comments on commit e470bce

Please sign in to comment.