# Class ServerLogsStreamService | EchoHub Documentation
Streams queued log events to the live log room as ephemeral messages: SignalR only (the IRC gateway never sees them) and no database rows. Ensures the room exists before streaming, recreating it on the fly if it was deleted. This class must never log from its streaming path — its namespace is excluded by as a second line of defense, but the primary rule is simply not to log per event, otherwise every streamed line would spawn another.

# Class ServerLogsStreamService

Namespace
  EchoHub.Server.Services.ServerLogs

Assembly
  EchoHub.Server.dll

Streams queued log events to the live log room as ephemeral messages: SignalR only (the IRC gateway never sees them) and no database rows. Ensures the room exists before streaming, recreating it on the fly if it was deleted.

This class must never log from its streaming path — its namespace is excluded by ServerLogsSink as a second line of defense, but the primary rule is simply not to log per event, otherwise every streamed line would spawn another.

    public sealed class ServerLogsStreamService : BackgroundService, IDisposable

Inheritance
  object
  BackgroundService
  ServerLogsStreamService

Implements
  IDisposable

Inherited Members
  object.GetType()
  object.ToString()
  object.Equals(object)
  object.Equals(object, object)
  object.ReferenceEquals(object, object)
  object.GetHashCode()

## Constructors

### ServerLogsStreamService(ServerLogsSink, ServerLogsOptions, IChannelService, IMessageEncryptionService, IServiceProvider)

    public ServerLogsStreamService(ServerLogsSink sink, ServerLogsOptions options, IChannelService channelService, IMessageEncryptionService encryption, IServiceProvider serviceProvider)

#### Parameters

`sink` ServerLogsSink
`options` ServerLogsOptions
`channelService` IChannelService
`encryption` IMessageEncryptionService
`serviceProvider` IServiceProvider

## Methods

### ExecuteAsync(CancellationToken)

    protected override Task ExecuteAsync(CancellationToken stoppingToken)

#### Parameters

`stoppingToken` CancellationToken

#### Returns

Task

### Format(LogEvent)

Formats an event like the file sink's template, minus the timestamp (clients render their own). Public for tests.

    public static string Format(LogEvent logEvent)

#### Parameters

`logEvent` LogEvent

#### Returns

string