Fix #3625: add the clear logs function.
This commit is contained in:
@ -29,6 +29,13 @@ namespace Oqtane.Services
|
||||
/// <returns></returns>
|
||||
Task<Log> GetLogAsync(int logId);
|
||||
|
||||
/// <summary>
|
||||
/// Clear the entire logs of the given site.
|
||||
/// </summary>
|
||||
/// <param name="siteId"></param>
|
||||
/// <returns></returns>
|
||||
Task ClearLogsAsync(int siteId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new log entry
|
||||
/// </summary>
|
||||
|
@ -35,6 +35,11 @@ namespace Oqtane.Services
|
||||
return await GetJsonAsync<Log>($"{Apiurl}/{logId}");
|
||||
}
|
||||
|
||||
public async Task ClearLogsAsync(int siteId)
|
||||
{
|
||||
await DeleteAsync($"{Apiurl}?siteid={siteId}&includeErrors=true");
|
||||
}
|
||||
|
||||
public async Task Log(int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args)
|
||||
{
|
||||
await Log(null, pageId, moduleId, userId, category, feature, function, level, exception, message, args);
|
||||
|
Reference in New Issue
Block a user