Added API: GET LogMessages and LogFile

resolves #10
This commit is contained in:
2023-09-05 20:02:12 +02:00
parent ae1184320f
commit c601541249
4 changed files with 29 additions and 2 deletions

View File

@ -8,6 +8,7 @@ public class Logger : TextWriter
private static readonly string LogDirectoryPath = RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
? "/var/log/tranga-api"
: Path.Join(Directory.GetCurrentDirectory(), "logs");
public string? logFilePath => _fileLogger?.logFilePath;
public override Encoding Encoding { get; }
public enum LoggerType
{
@ -69,4 +70,9 @@ public class Logger : TextWriter
{
return _memoryLogger.GetNewLines();
}
public string[] GetLog()
{
return _memoryLogger.GetLogMessages();
}
}