Search Results for

    Show / Hide Table of Contents
    View Source

    Class LogViewerService

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public class LogViewerService : ILogViewerService, IService

    Constructors

    View Source

    LogViewerService(ILogViewerQueryRepository, ICoreScopeProvider, ILoggingConfiguration, ILogViewerRepository)

    Declaration
    public LogViewerService(ILogViewerQueryRepository logViewerQueryRepository, ICoreScopeProvider provider, ILoggingConfiguration loggingConfiguration, ILogViewerRepository logViewerRepository)
    Parameters
    Type Name Description
    ILogViewerQueryRepository logViewerQueryRepository
    ICoreScopeProvider provider
    ILoggingConfiguration loggingConfiguration
    ILogViewerRepository logViewerRepository

    Methods

    View Source

    AddSavedLogQueryAsync(String, String)

    Adds a new saved log query to your chosen data source.

    Declaration
    public async Task<Attempt<ILogViewerQuery, LogViewerOperationStatus>> AddSavedLogQueryAsync(string name, string query)
    Parameters
    Type Name Description
    System.String name

    The name of the new saved log query.

    System.String query

    The query of the new saved log query.

    Returns
    Type Description
    Task<Attempt<ILogViewerQuery, LogViewerOperationStatus>>
    View Source

    CanViewLogsAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

    Returns a value indicating whether the log files for the given time period are not too large to view (more than 1GB).

    Declaration
    public async Task<Attempt<bool, LogViewerOperationStatus>> CanViewLogsAsync(DateTimeOffset? startDate, DateTimeOffset? endDate)
    Parameters
    Type Name Description
    System.Nullable<DateTimeOffset> startDate

    The start date for the date range.

    System.Nullable<DateTimeOffset> endDate

    The end date for the date range.

    Returns
    Type Description
    Task<Attempt<System.Boolean, LogViewerOperationStatus>>

    The value whether or not you are able to view the logs.

    View Source

    DeleteSavedLogQueryAsync(String)

    Deletes a saved log query to your chosen data source.

    Declaration
    public async Task<Attempt<ILogViewerQuery, LogViewerOperationStatus>> DeleteSavedLogQueryAsync(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the saved log search.

    Returns
    Type Description
    Task<Attempt<ILogViewerQuery, LogViewerOperationStatus>>
    View Source

    GetGlobalMinLogLevel()

    Get the minimum log level value from the config file.

    Declaration
    public LogLevel GetGlobalMinLogLevel()
    Returns
    Type Description
    LogLevel
    View Source

    GetLogLevelCountsAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

    Returns a number of the different log level entries. The attempt will fail if the log files for the given time period are too large (more than 1GB).

    Declaration
    public async Task<Attempt<LogLevelCounts, LogViewerOperationStatus>> GetLogLevelCountsAsync(DateTimeOffset? startDate, DateTimeOffset? endDate)
    Parameters
    Type Name Description
    System.Nullable<DateTimeOffset> startDate

    The start date for the date range.

    System.Nullable<DateTimeOffset> endDate

    The end date for the date range.

    Returns
    Type Description
    Task<Attempt<LogLevelCounts, LogViewerOperationStatus>>
    View Source

    GetLogLevelsFromSinks()

    Get the log level values of the global minimum and the UmbracoFile one from the config file.

    Declaration
    public ReadOnlyDictionary<string, LogLevel> GetLogLevelsFromSinks()
    Returns
    Type Description
    System.Collections.ObjectModel.ReadOnlyDictionary<System.String, LogLevel>
    View Source

    GetMessageTemplatesAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Int32, Int32)

    Returns a paged model of all unique message templates and their counts. The attempt will fail if the log files for the given time period are too large (more than 1GB).

    Declaration
    public async Task<Attempt<PagedModel<LogTemplate>, LogViewerOperationStatus>> GetMessageTemplatesAsync(DateTimeOffset? startDate, DateTimeOffset? endDate, int skip, int take)
    Parameters
    Type Name Description
    System.Nullable<DateTimeOffset> startDate

    The start date for the date range.

    System.Nullable<DateTimeOffset> endDate

    The end date for the date range.

    System.Int32 skip

    The amount of items to skip.

    System.Int32 take

    The amount of items to take.

    Returns
    Type Description
    Task<Attempt<PagedModel<LogTemplate>, LogViewerOperationStatus>>
    View Source

    GetPagedLogsAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Int32, Int32, Direction, String, String[])

    Gets all logs as a paged model. The attempt will fail if the log files for the given time period are too large (more than 1GB).

    Declaration
    public async Task<Attempt<PagedModel<ILogEntry>, LogViewerOperationStatus>> GetPagedLogsAsync(DateTimeOffset? startDate, DateTimeOffset? endDate, int skip, int take, Direction orderDirection = Direction.Descending, string filterExpression = null, string[] logLevels = null)
    Parameters
    Type Name Description
    System.Nullable<DateTimeOffset> startDate

    The start date for the date range.

    System.Nullable<DateTimeOffset> endDate

    The end date for the date range.

    System.Int32 skip

    The amount of items to skip.

    System.Int32 take

    The amount of items to take.

    Direction orderDirection

    The direction in which the log entries are to be ordered.

    System.String filterExpression

    The query expression to filter on.

    System.String[] logLevels

    The log levels for which to retrieve the log messages.

    Returns
    Type Description
    Task<Attempt<PagedModel<ILogEntry>, LogViewerOperationStatus>>
    View Source

    GetSavedLogQueriesAsync(Int32, Int32)

    Get all saved log queries from your chosen data source as a paged model.

    Declaration
    public async Task<PagedModel<ILogViewerQuery>> GetSavedLogQueriesAsync(int skip, int take)
    Parameters
    Type Name Description
    System.Int32 skip

    The amount of items to skip.

    System.Int32 take

    The amount of items to take.

    Returns
    Type Description
    Task<PagedModel<ILogViewerQuery>>
    View Source

    GetSavedLogQueryByNameAsync(String)

    Gets a saved log query by name from your chosen data source.

    Declaration
    public async Task<ILogViewerQuery> GetSavedLogQueryByNameAsync(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the saved log query.

    Returns
    Type Description
    Task<ILogViewerQuery>
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • LogViewerService(ILogViewerQueryRepository, ICoreScopeProvider, ILoggingConfiguration, ILogViewerRepository)
    • Methods
      • AddSavedLogQueryAsync(String, String)
      • CanViewLogsAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
      • DeleteSavedLogQueryAsync(String)
      • GetGlobalMinLogLevel()
      • GetLogLevelCountsAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
      • GetLogLevelsFromSinks()
      • GetMessageTemplatesAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Int32, Int32)
      • GetPagedLogsAsync(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Int32, Int32, Direction, String, String[])
      • GetSavedLogQueriesAsync(Int32, Int32)
      • GetSavedLogQueryByNameAsync(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX