Skip to content
Docs Try Aspire

ResourceLoggerService Methods

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