Class ProxyLoggingOptions
Central configuration for the proxy's built-in diagnostic logging. A single instance is owned by Logging; mutate its properties (or replace the whole object) before Start(bool) to control how the proxy reports every caught exception and diagnostic event. Logging never blocks proxy traffic: built-in sinks are asynchronous and best-effort, and setting Enabled to false removes all logging overhead (no timestamps are read, no strings are formatted, no providers run).
Inherited Members
Namespace: Titanium.Web.Proxy.Logging
Assembly: Titanium.Web.Proxy.dll
Syntax
public sealed class ProxyLoggingOptions
Properties
| Edit this page View SourceAdditionalLoggerProviders
Host-supplied sinks appended after the built-in console and file sinks. Empty by default, which leaves the sink list unchanged. The proxy does not dispose these providers; it disposes only the sinks it created. Ignored when LoggerFactory is set or Enabled is false.
Declaration
public IList<ILoggerProvider> AdditionalLoggerProviders { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<ILoggerProvider> |
EnableConsole
Whether the built-in async console sink is active. Defaults to true so Error+ failures are visible without configuration. Ignored when LoggerFactory is set. Writes never block session threads (bounded channel + background writer).
Declaration
public bool EnableConsole { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
EnableConsoleColors
Whether the built-in console sink colors each line by LogLevel using ANSI escape
codes (dim for Trace/Debug, default for
Information, yellow for Warning, red for
Error, bold red for Critical). Defaults to
true; automatically suppressed - regardless of this setting - for a stream
(stdout/stderr) that is redirected (e.g. piped to a file), or entirely when the
NO_COLOR environment variable (see https://no-color.org/) is set, so
redirected output/log files never contain raw escape codes.
Declaration
public bool EnableConsoleColors { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
EnableFile
Whether the built-in rolling-file sink is active. Defaults to false. Ignored when LoggerFactory is set.
Declaration
public bool EnableFile { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Enabled
Master switch for all proxy logging. Defaults to true so NuGet consumers surface real failures out of the box (paired with MinimumLevel of Error and the async console sink). Set to false for zero overhead: the proxy uses a no-op logger and performs no log-related work (preferred for probes and perf-sensitive hosts). Host apps should treat richer levels/file sinks as Debug-on / Release-opt-in.
Declaration
public bool Enabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
FilePath
Path of the log file used by the built-in rolling-file sink. Relative paths are resolved against the current working directory. The containing directory is created on demand.
Declaration
public string FilePath { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
LoggerFactory
Optional externally supplied ILoggerFactory (e.g. bridging to Serilog, NLog, or an ASP.NET Core host's logging pipeline). When set, the built-in Console/File sinks are not created and this factory is used verbatim; the proxy never disposes a factory it does not own. AdditionalLoggerProviders is not consulted in that case.
Declaration
public ILoggerFactory? LoggerFactory { get; set; }
Property Value
| Type | Description |
|---|---|
| ILoggerFactory |
MaxFileSizeBytes
Maximum size, in bytes, a log file is allowed to reach before it is rolled. Defaults to 10 MiB.
Declaration
public long MaxFileSizeBytes { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
MaxRolledFiles
Maximum number of rolled-over log files retained alongside the active log file. Defaults to 5.
Declaration
public int MaxRolledFiles { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MinimumLevel
The minimum LogLevel that is actually written to any sink. Every caught exception in the proxy is still reported to the gateway regardless of this setting - this only controls how much of that stream is materialized/written. Defaults to Error so out-of-the-box NuGet behavior stays quiet while still surfacing genuinely unexpected failures. Raise the level (and/or enable file) only when diagnosing.
Declaration
public LogLevel MinimumLevel { get; set; }
Property Value
| Type | Description |
|---|---|
| LogLevel |
QueueCapacity
Capacity of the bounded in-memory queue used by each built-in sink before entries are considered saturated (see the sink's own delivery guarantees). Defaults to 4096.
Declaration
public int QueueCapacity { get; set; }
Property Value
| Type | Description |
|---|---|
| int |