add ability to view error.log in System Info

This commit is contained in:
Shaun Walker
2023-01-05 10:18:55 -05:00
parent 7bebfe1919
commit 1616f94b86
3 changed files with 45 additions and 8 deletions

View File

@ -6,6 +6,7 @@ using System;
using Microsoft.AspNetCore.Hosting;
using Oqtane.Infrastructure;
using Microsoft.AspNetCore.Http.Features;
using System.IO;
namespace Oqtane.Controllers
{
@ -53,6 +54,15 @@ namespace Oqtane.Controllers
systeminfo.Add("UseSwagger", _configManager.GetSetting("UseSwagger", "true"));
systeminfo.Add("PackageService", _configManager.GetSetting("PackageService", "true"));
break;
case "log":
string log = "";
string path = Path.Combine(_environment.ContentRootPath, "Content", "Log", "error.log");
if (System.IO.File.Exists(path))
{
log = System.IO.File.ReadAllText(path);
}
systeminfo.Add("Log", log);
break;
}
return systeminfo;