Skip to content
DocsTry Aspire
DocsTry

ResourceLoggerService Methods

ClassMethods11 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)
{
// ...
}
}
resourceNamestring
Completes the log stream for the resource.
public class ResourceLoggerService
{
public void Complete(
IResource resource)
{
// ...
}
}
resourceIResourceThe IResource.
Completes the log stream for the resource.
public class ResourceLoggerService
{
public void Complete(
string name)
{
// ...
}
}
namestringThe name of the resource.
Disposes the service and completes all log streams.
public class ResourceLoggerService
{
public void Dispose()
{
// ...
}
}
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)
{
// ...
}
}
resourceIResourceThe 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)
{
// ...
}
}
resourceNamestringThe 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)
{
// ...
}
}
resourceIResourceThe resource name
ILoggerAn 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)
{
// ...
}
}
resourceNamestringThe name of the resource from the Aspire application model.
ILoggerAn 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))
{
// ...
}
}
cancellationTokenCancellationTokenoptional
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)
{
// ...
}
}
resourceIResourceThe 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)
{
// ...
}
}
resourceNamestringThe resource name
IAsyncEnumerable<IReadOnlyList<LogLine>>An async enumerable that returns the logs as they are written.