EnableDebugLogging

EnableDebugLogging toggles verbose diagnostic logs from the native llama.cpp layer. Off by default to minimize production overhead; flip on when investigating a specific problem.

Quick reference

Type bool
Default false
Category Engine
Field on EngineParameters.EnableDebugLogging

What it does

  • false (default) — the native layer produces no diagnostic output. Inference runs at full throughput.
  • true — the native layer emits tagged lines ([MM], [CTX], [KV], etc.) via NativeLoggerAdapter into the ILogger you pass to AsposeLLMApi.Create. Lines are also written to the file at LogDirectoryPath.

Debug logging adds measurable overhead — typically 5-15 % throughput loss. Not intended for production.

When to change it

Scenario Value
Default production false
Diagnosing template mismatch, KV eviction, vision alignment true
Benchmarking a specific backend false (avoid logging overhead)
CI / staging runs Either — depends on debugging requirements

Example

using Microsoft.Extensions.Logging;

using var loggerFactory = LoggerFactory.Create(b =>
    b.AddConsole().SetMinimumLevel(LogLevel.Debug));
var logger = loggerFactory.CreateLogger<Program>();

var preset = new Qwen25Preset();
preset.EngineParameters.EnableDebugLogging = true;
preset.EngineParameters.LogDirectoryPath = "logs/debug-run.log";

using var api = AsposeLLMApi.Create(preset, logger);
// Tagged [MM], [CTX], [KV] lines flow to both the logger and the file.

Interactions

What’s next