ResourceLoggerService Methods
Class Methods 10 members
A service that provides loggers for resources to write to.
ClearBacklog(string) Section titled ClearBacklog(string) Clears the log stream's backlog for the resource.
public class ResourceLoggerService{ public void ClearBacklog( string resourceName) { // ... }}Parameters
resourceName string Complete(IResource) Section titled Complete(IResource) Completes the log stream for the resource.
public class ResourceLoggerService{ public void Complete( IResource resource) { // ... }}Complete(string) Section titled Complete(string) Completes the log stream for the resource.
public class ResourceLoggerService{ public void Complete( string name) { // ... }}Parameters
name string The name of the resource. GetAllAsync(IResource) Section titled GetAllAsync(IResource) IAsyncEnumerable<IReadOnlyList<LogLine>> Get all logs for a resource. This will return all logs that have been written to the log stream for the resource and then complete.
public class ResourceLoggerService{ public IAsyncEnumerable<IReadOnlyList<LogLine>> GetAllAsync( IResource resource) { // ... }}Parameters
resource IResource The resource to get all logs for. Returns
IAsyncEnumerable<IReadOnlyList<LogLine>> An async enumerable that returns all logs that have been written to the log stream and then completes. Get all logs for a resource. This will return all logs that have been written to the log stream for the resource and then complete.
public class ResourceLoggerService{ public IAsyncEnumerable<IReadOnlyList<LogLine>> GetAllAsync( string resourceName) { // ... }}Parameters
resourceName string The resource name Returns
IAsyncEnumerable<IReadOnlyList<LogLine>> An async enumerable that returns all logs that have been written to the log stream and then completes. Gets the logger for the resource to write to.
public class ResourceLoggerService{ public ILogger GetLogger( IResource resource) { // ... }}Parameters
resource IResource The resource name Returns
ILogger An Logging.ILogger which represents the resource. Gets the logger for the resource to write to.
public class ResourceLoggerService{ public ILogger GetLogger( string resourceName) { // ... }}Parameters
resourceName string The name of the resource from the Aspire application model. Returns
ILogger An Logging.ILogger which represents the named resource. WatchAnySubscribersAsync(CancellationToken) Section titled WatchAnySubscribersAsync(CancellationToken) IAsyncEnumerable<LogSubscriber> Watch for subscribers to the log stream for a resource.
public class ResourceLoggerService{ public IAsyncEnumerable<LogSubscriber> WatchAnySubscribersAsync( CancellationToken cancellationToken = default(CancellationToken)) { // ... }}Parameters
cancellationToken CancellationToken optional Returns
IAsyncEnumerable<LogSubscriber> An async enumerable that returns when the first subscriber is added to a log, or when the last subscriber is removed. Watch for changes to the log stream for a resource.
public class ResourceLoggerService{ public IAsyncEnumerable<IReadOnlyList<LogLine>> WatchAsync( IResource resource) { // ... }}Parameters
resource IResource The resource to watch for logs. Returns
IAsyncEnumerable<IReadOnlyList<LogLine>> An async enumerable that returns the logs as they are written. Watch for changes to the log stream for a resource.
public class ResourceLoggerService{ public IAsyncEnumerable<IReadOnlyList<LogLine>> WatchAsync( string resourceName) { // ... }}Parameters
resourceName string The resource name Returns
IAsyncEnumerable<IReadOnlyList<LogLine>> An async enumerable that returns the logs as they are written.