Interface ILogViewer
Represents a log viewer that provides access to log entries.
Namespace: Umbraco.Cms.Core.Logging.Viewer
Assembly: Umbraco.Infrastructure.dll
Syntax
[Obsolete("Use ILogViewerService instead. Scheduled for removal in Umbraco 18.")]
public interface ILogViewer
Properties
View SourceCanHandleLargeLogs
Gets a value indicating whether this log viewer supports processing large log files efficiently.
Declaration
bool CanHandleLargeLogs { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceAddSavedSearch(string, string)
Adds a new saved search to chosen data source and returns the updated searches
Declaration
[Obsolete("Use ILogViewerService.AddSavedLogQueryAsync instead. Scheduled for removal in Umbraco 15.")]
IReadOnlyList<SavedLogSearch> AddSavedSearch(string name, string query)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| string | query |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<SavedLogSearch> |
CheckCanOpenLogs(LogTimePeriod)
Determines whether the logs can be opened for the specified time period.
Declaration
[Obsolete("Use ILogViewerService.CanViewLogsAsync instead. Scheduled for removal in Umbraco 15.")]
bool CheckCanOpenLogs(LogTimePeriod logTimePeriod)
Parameters
| Type | Name | Description |
|---|---|---|
| LogTimePeriod | logTimePeriod | The time period for which to check log accessibility. |
Returns
| Type | Description |
|---|---|
| bool | True if logs can be opened for the specified time period; otherwise, false. |
DeleteSavedSearch(string)
Deletes a saved search from the chosen data source and returns the remaining saved searches.
Declaration
[Obsolete("Use ILogViewerService.DeleteSavedLogQueryAsync instead. Scheduled for removal in Umbraco 15.")]
IReadOnlyList<SavedLogSearch> DeleteSavedSearch(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the saved search to delete. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<SavedLogSearch> | A read-only list of the remaining saved log searches after deletion. |
GetLogLevelCounts(LogTimePeriod)
Returns the counts of log entries for each log level within the specified time period.
Declaration
[Obsolete("Use ILogViewerService.GetLogLevelCounts instead. Scheduled for removal in Umbraco 15.")]
LogLevelCounts GetLogLevelCounts(LogTimePeriod logTimePeriod)
Parameters
| Type | Name | Description |
|---|---|---|
| LogTimePeriod | logTimePeriod | The time period over which to count log levels. |
Returns
| Type | Description |
|---|---|
| LogLevelCounts | A LogLevelCounts object representing the counts of each log level. |
GetLogs(LogTimePeriod, int, int, Direction, string?, string[]?)
Returns a paged collection of log messages for the specified time period and filter criteria.
Declaration
[Obsolete("Use ILogViewerService.GetPagedLogs instead. Scheduled for removal in Umbraco 15.")]
PagedResult<LogMessage> GetLogs(LogTimePeriod logTimePeriod, int pageNumber = 1, int pageSize = 100, Direction orderDirection = Direction.Descending, string? filterExpression = null, string[]? logLevels = null)
Parameters
| Type | Name | Description |
|---|---|---|
| LogTimePeriod | logTimePeriod | The time period for which to retrieve logs. |
| int | pageNumber | The page number to retrieve. Defaults to 1. |
| int | pageSize | The number of log entries per page. Defaults to 100. |
| Direction | orderDirection | The direction in which to order the logs (ascending or descending). Defaults to descending. |
| string | filterExpression | An optional filter expression to filter logs. |
| string[] | logLevels | An optional array of log levels to include. |
Returns
| Type | Description |
|---|---|
| PagedResult<LogMessage> | A paged result containing the log messages. |
Remarks
This method is obsolete. Use ILogViewerService.GetPagedLogs instead. Scheduled for removal in Umbraco 15.
GetLogsAsPagedModel(LogTimePeriod, int, int, Direction, string?, string[]?)
Retrieves a paged model of log messages filtered by the specified parameters.
Declaration
[Obsolete("Use ILogViewerService.GetPagedLogs instead. Scheduled for removal in Umbraco 15.")]
PagedModel<LogMessage> GetLogsAsPagedModel(LogTimePeriod logTimePeriod, int skip, int take, Direction orderDirection = Direction.Descending, string? filterExpression = null, string[]? logLevels = null)
Parameters
| Type | Name | Description |
|---|---|---|
| LogTimePeriod | logTimePeriod | The time period to filter logs. |
| int | skip | The number of log entries to skip. |
| int | take | The number of log entries to take. |
| Direction | orderDirection | The direction to order the log entries. Defaults to Descending. |
| string | filterExpression | An optional filter expression to apply to the logs. |
| string[] | logLevels | An optional array of log levels to filter by. |
Returns
| Type | Description |
|---|---|
| PagedModel<LogMessage> | A paged model containing the filtered log messages. |
Remarks
This method is obsolete. Use ILogViewerService.GetPagedLogs instead.
GetMessageTemplates(LogTimePeriod)
Returns a list of all unique message templates and their counts
Declaration
[Obsolete("Use ILogViewerService.GetMessageTemplates instead. Scheduled for removal in Umbraco 15.")]
IEnumerable<LogTemplate> GetMessageTemplates(LogTimePeriod logTimePeriod)
Parameters
| Type | Name | Description |
|---|---|---|
| LogTimePeriod | logTimePeriod |
Returns
| Type | Description |
|---|---|
| IEnumerable<LogTemplate> |
GetNumberOfErrors(LogTimePeriod)
Returns the number of error log entries within a specified time period. Errors are counted by including warnings with exceptions, as well as error and fatal messages.
Declaration
int GetNumberOfErrors(LogTimePeriod logTimePeriod)
Parameters
| Type | Name | Description |
|---|---|---|
| LogTimePeriod | logTimePeriod | The time period over which to count errors. |
Returns
| Type | Description |
|---|---|
| int | The number of errors in the specified time period. |
GetSavedSearches()
Retrieves all saved log searches from the configured data source.
Declaration
[Obsolete("Use ILogViewerService.GetSavedLogQueriesAsync instead. Scheduled for removal in Umbraco 15.")]
IReadOnlyList<SavedLogSearch> GetSavedSearches()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<SavedLogSearch> | A read-only list of saved log searches. |