Skip to content

Configuration

Logix can be configured with the fluent API at runtime or with ScriptableObject assets in the Editor.

Fluent API

Log.WithOptions(o =>
{
    o.EnableFileLogging = true;
    o.LogFilePath = "Logs/Game.log";
    o.MaxLogFileSize = 50L * 1024 * 1024;
    o.EnableTimestamps = true;
    o.TimeoutSeconds = 5;
    o.Levels = new HashSet<LogLevel> { LogLevel.Info, LogLevel.Warning, LogLevel.Error };
});

Log.Container.AddSink(new FileLogSink("Game.log"));
Log.Container.AddSink(new DiscordSink("https://discord.com/api/webhooks/..."));
Log.Container.AddFilter(new LevelFilter(LogLevel.Warning));

LogOptions

Property Default Description
EnableFileLogging false Auto-add a FileLogSink
LogFilePath "Logs.txt" Path for the file sink
MaxLogFileSize 52,428,800 (50 MB) Auto-rotation threshold
CaptureUnityDebugLogs true Hook Debug.Log calls from Unity and third-party code
TimeoutSeconds 5 Max time to wait for log semaphore
Levels null (all levels) HashSet of allowed levels

Levels acts as a global level filter - messages at levels not in the set are dropped before any filter or sink runs.

Fluent helpers

Log.Container.AddSink(new MySink());
Log.Container.AddFilter(new MyFilter());
Log.Container.RemoveSink(sink);
Log.Container.ClearSinks();
Log.Container.ClearFilters();
Log.Container.WithFileLogging();
Log.Container.DisableFileLogging();
Log.Container.SetTimeout(10);

ScriptableObject assets

Logix provides several ScriptableObject types. Create them from the Create menu:

Asset Menu Path Purpose
LogixSettingsSO Logix -> Global Settings Full settings: global filters + sink config lists
EndpointSettingsSO Logix -> Remote -> Endpoint Settings URL-based sink config (Discord, Slack, HTTP, WebSocket)
LokiSinkSettingsSO Logix -> Remote -> Loki Settings Loki-specific config with auth token + tenant ID
FilterSettingsSO Logix -> Filter Reusable filter set (levels, namespaces, classes, directories, regex)

Loading at runtime

The LogixInitializer automatically loads saved settings on startup. It applies options, creates cloud sinks, and wires up the UnityLogSink.

// Manual load
var settings = Resources.Load<LogixOptionsSO>("MySettings");
Log.WithScriptableObject(settings);

LogixSettingsSO fields

When you create a LogixSettingsSO (Logix -> Global Settings) and open it in the Inspector, you see these groups:

  • General settings - whether to write logs to a file, the file path, max file size, and timeout
  • Unity Log Capture - toggle capture of Debug.Log/Debug.LogWarning/Debug.LogError from Unity and third-party code (on by default)
  • Console settings - how many log entries to keep in memory (1000 by default)
  • Filters - drag a FilterSettingsSO here to filter messages before they reach any sink
  • Remote sink configs - lists for Discord, Slack, Loki, HTTP, and WebSocket. Drag EndpointSettingsSO or LokiSinkSettingsSO assets into these lists to add remote sinks

Once you drag this asset onto the Editor Window toolbar, everything is picked up automatically in builds.

When you assign a LogixSettingsSO asset to the Editor Window toolbar, it works in builds without any manual loading code.