Skip to content
Matteo Gregoricchio edited this page May 7, 2024 · 11 revisions

Reference namespace: Serilog.Ui.Core

API

IDataProvider

// the Provider unique name
string Name { get; }

// Fetch the data and returns a Tuple, consisting of
// - an IEnumerable of LogModel
// - the total number of matches obtained with the non-paginated query.
Task<(IEnumerable<LogModel> results, int total)> FetchDataAsync(
  FetchLogsQuery queryParams,
  CancellationToken cancellationToken = default);

IAuth

... to register implementation, check configuration:

FetchLogsQuery class

// the unique provider name to run the query on
string DatabaseKey
// the 0-based page (used by the providers)
int Page
// the actual page (used by the client-app) [Linq.Skip]
int CurrentPage
// the amount of results to retrieve in a single request [Linq.Take]
int Count
// a log level filter
string Level
// a text search
string SearchCriteria
DateTime? StartDate
DateTime? EndDate
SearchOptions.SortProperty SortOn = SearchOptions.SortProperty.Timestamp;
SearchOptions.SortDirection SortBy = SearchOptions.SortDirection.Desc;

LogModel class

virtual int RowNo { private set; }
virtual string Level
virtual string Message
virtual DateTime Timestamp
virtual string Exception
virtual string Properties
virtual string PropertyType
// use to set the RowNo; 
// rowNoStart should be {FetchLogsQuery}.Count * {FetchLogsQuery}.Page
LogModel SetRowNo(int rowNoStart, int index)

Implement a custom authorization filter

Implement a custom provider

disable sort

additional columns

Clone this wiki locally