Logger_MM.Agent 1.3.0

dotnet add package Logger_MM.Agent --version 1.3.0
                    
NuGet\Install-Package Logger_MM.Agent -Version 1.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Logger_MM.Agent" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Logger_MM.Agent" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Logger_MM.Agent" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Logger_MM.Agent --version 1.3.0
                    
#r "nuget: Logger_MM.Agent, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Logger_MM.Agent@1.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Logger_MM.Agent&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Logger_MM.Agent&version=1.3.0
                    
Install as a Cake Tool

Logger_MM.Agent

Logging agent for Logger_MM Observer. Fire-and-forget logging with offline buffering.

Installation

dotnet add package Logger_MM.Agent

Quick Start

using Logger_MM.Agent;

// Create agent
var agent = new LoggerMMAgent(
    observerUrl: "http://your-server:5080",
    apiKey: "your-api-key",
    appName: "MyApp",
    appVersion: "1.0.0",
    environment: "Production"
);

// Start session
await agent.StartAsync();

// Log messages
agent.Info("MyModule", "MyFunction", "Hello from Logger_MM!");
agent.Error("MyModule", "MyFunction", "Something went wrong", exception: ex);

// Stop on shutdown
await agent.StopAsync();

Logging Methods

By Level

agent.Debug(module, function, message, ...);
agent.Info(module, function, message, ...);
agent.Warning(module, function, message, ...);
agent.Error(module, function, message, exception: ex, ...);
agent.Critical(module, function, message, exception: ex, ...);

By Type

agent.UserAction(module, function, message, ...);
agent.LlmCall(module, function, message, ...);
agent.ContentCreation(module, function, message, ...);
agent.ContentDownload(module, function, message, ...);

Full Control

agent.Log(
    level: "Error",
    type: "UserAction",
    module: "PaymentModule",
    function: "ProcessPayment",
    message: "Payment failed",
    user: "john.doe",
    @params: new { orderId = 123 },
    input: requestData,
    output: responseData,
    exception: ex,
    tags: new[] { "payment", "error" },
    correlationId: "req-456"
);

Session Management

// Start session (required before logging)
await agent.StartAsync();

// Check connection
if (agent.IsConnected) { ... }

// Keep session alive (if not sending logs for extended periods)
// Sessions auto-close after 1 hour of inactivity
await agent.PingAsync();

// Flush logs immediately
await agent.FlushAsync();

// Stop and close session
await agent.StopAsync();

Attachments

using Logger_MM.Agent.Attachments;

// Upload file first
var fileId = await agent.UploadFileAsync(imageBytes, "screenshot.png", "image/png");

// Attach to log
agent.Info("UI", "Screenshot", "Captured screen",
    attachments: new[] { Attachment.Image(fileId.Value, "screenshot.png") });

// Inline attachments (no upload needed)
agent.Info("API", "Response", "Got data",
    attachments: new[] { Attachment.Json(responseObject, "response") });

ASP.NET Core Integration

// Program.cs
builder.Services.AddSingleton<LoggerMMAgent>(sp =>
    new LoggerMMAgent(
        observerUrl: builder.Configuration["LoggerMM:Url"],
        apiKey: builder.Configuration["LoggerMM:ApiKey"],
        appName: "MyWebApp",
        appVersion: "1.0.0",
        environment: builder.Environment.EnvironmentName
    ));

var app = builder.Build();

// Start on startup
var agent = app.Services.GetRequiredService<LoggerMMAgent>();
await agent.StartAsync();

// Stop on shutdown
app.Lifetime.ApplicationStopping.Register(() =>
    agent.StopAsync().GetAwaiter().GetResult());

Features

  • Fire-and-forget: Logs are queued and sent in background
  • Offline buffering: Logs are saved locally if server is unavailable
  • Batch sending: Logs are sent in batches for efficiency
  • Session tracking: Each app instance gets unique session
  • Auto-reconnect: Automatically retries failed sends
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 483 12/22/2025
1.2.0 189 12/22/2025
1.1.0 196 12/22/2025
1.0.0 289 12/16/2025