View Source
  Class LogViewerController
  
  Backoffice controller supporting the dashboard for viewing logs with some simple graphs & filtering
 
  
  
    Inheritance
      System.Object
      Microsoft.AspNetCore.Mvc.ControllerBase
      
      
      
      
      
      
   
  
  Assembly: Umbraco.Web.BackOffice.dll
  Syntax
  
    [Authorize(Policy = "SectionAccessSettings")]
public class LogViewerController : BackOfficeNotificationsController
   
  Constructors
  
  
    View Source
  
  LogViewerController(ILogViewer, ILogLevelLoader)
  
  
  Declaration
  
    [ActivatorUtilitiesConstructor]
public LogViewerController(ILogViewer logViewer, ILogLevelLoader logLevelLoader)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | ILogViewer | 
        logViewer | 
         | 
      
      
        | ILogLevelLoader | 
        logLevelLoader | 
         | 
      
    
  
  Methods
  
  
    View Source
  
  DeleteSavedSearch(SavedLogSearch)
  
  
  Declaration
  
    [HttpPost]
public IEnumerable<SavedLogSearch> DeleteSavedSearch(SavedLogSearch item)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | SavedLogSearch | 
        item | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | IEnumerable<SavedLogSearch> | 
         | 
      
    
  
  
    View Source
  
  GetCanViewLogs(Nullable<DateTime>, Nullable<DateTime>)
  
  
  Declaration
  
    [HttpGet]
public bool GetCanViewLogs([FromQuery] DateTime? startDate = null, [FromQuery] DateTime? endDate = null)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Nullable<DateTime> | 
        startDate | 
         | 
      
      
        | System.Nullable<DateTime> | 
        endDate | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    View Source
  
  GetLogLevelCounts(Nullable<DateTime>, Nullable<DateTime>)
  
  
  Declaration
  
    [HttpGet]
public ActionResult<LogLevelCounts> GetLogLevelCounts([FromQuery] DateTime? startDate = null, [FromQuery] DateTime? endDate = null)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Nullable<DateTime> | 
        startDate | 
         | 
      
      
        | System.Nullable<DateTime> | 
        endDate | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<LogLevelCounts> | 
         | 
      
    
  
  
    View Source
  
  GetLogLevels()
  
  
  Declaration
  
    [HttpGet]
public ReadOnlyDictionary<string, LogEventLevel?> GetLogLevels()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Collections.ObjectModel.ReadOnlyDictionary<System.String, System.Nullable<LogEventLevel>> | 
         | 
      
    
  
  
    View Source
  
  GetLogs(String, Int32, String, String[], Nullable<DateTime>, Nullable<DateTime>)
  
  
  Declaration
  
    [HttpGet]
public ActionResult<PagedResult<LogMessage>> GetLogs(string orderDirection = "Descending", int pageNumber = 1, string filterExpression = null, [FromQuery(Name = "logLevels[]")] string[] logLevels = null, [FromQuery] DateTime? startDate = null, [FromQuery] DateTime? endDate = null)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        orderDirection | 
         | 
      
      
        | System.Int32 | 
        pageNumber | 
         | 
      
      
        | System.String | 
        filterExpression | 
         | 
      
      
        | System.String[] | 
        logLevels | 
         | 
      
      
        | System.Nullable<DateTime> | 
        startDate | 
         | 
      
      
        | System.Nullable<DateTime> | 
        endDate | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<PagedResult<LogMessage>> | 
         | 
      
    
  
  
    View Source
  
  GetMessageTemplates(Nullable<DateTime>, Nullable<DateTime>)
  
  
  Declaration
  
    [HttpGet]
public ActionResult<IEnumerable<LogTemplate>> GetMessageTemplates([FromQuery] DateTime? startDate = null, [FromQuery] DateTime? endDate = null)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Nullable<DateTime> | 
        startDate | 
         | 
      
      
        | System.Nullable<DateTime> | 
        endDate | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<LogTemplate>> | 
         | 
      
    
  
  
    View Source
  
  GetNumberOfErrors(Nullable<DateTime>, Nullable<DateTime>)
  
  
  Declaration
  
    [HttpGet]
public ActionResult<int> GetNumberOfErrors([FromQuery] DateTime? startDate = null, [FromQuery] DateTime? endDate = null)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Nullable<DateTime> | 
        startDate | 
         | 
      
      
        | System.Nullable<DateTime> | 
        endDate | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<System.Int32> | 
         | 
      
    
  
  
    View Source
  
  GetSavedSearches()
  
  
  Declaration
  
    [HttpGet]
public IEnumerable<SavedLogSearch> GetSavedSearches()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | IEnumerable<SavedLogSearch> | 
         | 
      
    
  
  
    View Source
  
  PostSavedSearch(SavedLogSearch)
  
  
  Declaration
  
    [HttpPost]
public IEnumerable<SavedLogSearch> PostSavedSearch(SavedLogSearch item)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | SavedLogSearch | 
        item | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | IEnumerable<SavedLogSearch> | 
         |