Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1074 from cocoa-mhlw/feature/event-log-file-name
Browse files Browse the repository at this point in the history
イベントログの書き出しの不具合を修正
  • Loading branch information
cocoa-dev004 authored Jul 11, 2022
2 parents 35859b5 + 284261f commit 6f86521
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Covid19Radar/Covid19Radar/Repository/EventLogRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private string GetFileName(EventLog eventLog)

using var sha = SHA256.Create();
var textBytes = Encoding.UTF8.GetBytes(clearText);
string hash = Convert.ToBase64String(sha.ComputeHash(textBytes));
string hash = Convert.ToBase64String(sha.ComputeHash(textBytes)).TrimEnd('=').Replace('+', '-').Replace('/', '_');

return $"{hash}{LOG_EXTENSION}";
}
Expand Down Expand Up @@ -104,6 +104,7 @@ private async Task<bool> AddAsyncInternal(EventLog eventLog, long maxSize)
}

await File.WriteAllTextAsync(filePath, serializedJson);
_loggerService.Info($"Write event log. filePath:{filePath}");

return true;
}
Expand Down

0 comments on commit 6f86521

Please sign in to comment.