Logger
Control runtime logging with Serilog minimum level and custom logger configuration.
Minimum Level
Use WithMinimumLogLevel to set runtime log filtering (Verbose, Debug, Information, Warning, Error, Fatal).
Custom Logger Factory
Use WithLoggerConfig(() => new LoggerConfiguration(...)) to inject a project-specific Serilog setup.
Configuration-Based Logging
Minimum log level can also be set through JSON/CLI using LoadStrike:MinimumLogLevel or --minimumloglevel. Accepted tokens map to log level names and numeric values (0..5). Invalid values are ignored so the existing/default level stays active.
Feature Usage Samples
How to use snippets for Logger.
Switch between C#, Java, Python, TypeScript, and JavaScript to see the native SDK shape for this sample.
Licensing note: every runnable sample requires a valid runner key via WithRunnerKey("...") or config key LoadStrike:RunnerKey.
Logger
LoadStrikeRunner.RegisterScenarios(scenario)
.WithMinimumLogLevel(LogEventLevel.Information)
.WithLoggerConfig(() => new LoggerConfiguration().WriteTo.Console())
.WithRunnerKey("rkl_your_local_runner_key")
.Run();
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeLogLevel;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeLogger;
LoadStrikeRunner.registerScenarios(scenario)
.withMinimumLogLevel(LoadStrikeLogLevel.Warning)
.withLoggerConfig(() -> new LoadStrikeLogger() {
@Override
public void info(String message) {
System.out.println("[loadstrike] " + message);
}
})
.withRunnerKey("rkl_your_local_runner_key")
.run();
class ConsoleLogger:
def debug(self, message: str) -> None:
print(f"[debug] {message}")
def info(self, message: str) -> None:
print(f"[info] {message}")
def warn(self, message: str) -> None:
print(f"[warn] {message}")
def error(self, message: str) -> None:
print(f"[error] {message}")
LoadStrikeRunner.register_scenarios(scenario) \
.with_minimum_log_level("Warning") \
.with_logger_config(lambda: ConsoleLogger()) \
.with_runner_key("rkl_your_local_runner_key") \
.run()
LoadStrikeRunner.registerScenarios(scenario)
.withMinimumLogLevel("Warning")
.withLoggerConfig(() => ({
debug: (message) => console.debug(message),
info: (message) => console.info(message),
warn: (message) => console.warn(message),
error: (message) => console.error(message)
}))
.withRunnerKey("rkl_your_local_runner_key")
.run();
LoadStrikeRunner.registerScenarios(scenario)
.withMinimumLogLevel("Warning")
.withLoggerConfig(() => ({
debug: (message) => console.debug(message),
info: (message) => console.info(message),
warn: (message) => console.warn(message),
error: (message) => console.error(message)
}))
.withRunnerKey("rkl_your_local_runner_key")
.run();
Logger APIs
Set the minimum runtime log level so lower-priority events are filtered out before they are written.
Provide a custom Serilog configuration factory when your project needs specific sinks or enrichers.
Verbose, Debug, Information, Warning, Error, and Fatal are supported across the public config surface.
Config-based logging also accepts numeric 0 through 5 tokens that map to the same ordered levels.