Appearance
Getting Started with EventLoomer
Welcome to EventLoomer! This guide will walk you through the basic steps to start sending logs to EventLoomer from any application using our HTTP API, with specific details for our .NET SDK.
Prerequisites
Before you begin, make sure you have:
- An EventLoomer Account: Sign up or log in. (Adjust link if needed)
- A Team: Create or select a Team within the EventLoomer UI.
- Your Team API Key: Find this in Team Settings. Treat this key securely.
- (For Application Logs) A Project: Create a Project within your Team.
- (For Application Logs) Your Project ID: Find this on the Project Details page. This is required for automatic
ILogger
integration (Application Logs). - EventLoomer Base URL: The URL of your EventLoomer API instance (e.g.,
https://api.eventloomer.com
).
1. Understanding Log Types
EventLoomer distinguishes between two main types of logs:
- Event/Step Logs (External Logs): Tied to specific business processes or workflows you define as Events and Steps in the UI using unique string identifiers. Use this for tracking progress through defined flows. Sent to
/api/ExternalLogs
. - Application Logs: General diagnostic or operational logs originating from specific parts of your application (like classes or modules), associated with a Project ID. Use this for standard application logging. Sent to
/api/ApplicationLogs
.
2. Sending Logs via HTTP API (Any Language)
You can send logs from any application capable of making HTTP POST requests.
Authentication:
Include your Team API Key in the X-API-Key
header for all requests.
http
POST /api/... HTTP/1.1
Host: your-eventloomer-instance.com
Content-Type: application/json
X-API-Key: YOUR_TEAM_API_KEY
{ ... request body ... }
Example: Sending an Event/Step Log (/api/ExternalLogs
)
Use this endpoint when logging against a predefined Event or Step.
http
POST /api/ExternalLogs HTTP/1.1
Host: your-eventloomer-instance.com
Content-Type: application/json
X-API-Key: YOUR_TEAM_API_KEY
{
"uniqueIdentifier": "order-payment-attempted",
"payload": "{\"orderId\": 12345, \"gateway\": \"Stripe\", \"success\": true}",
"level": "Information",
"correlationKey": "corr-abc-123",
"environment": "Production"
}
Example: Sending an Application Log (/api/ApplicationLogs
)
Use this endpoint for general application logs associated with a Project.
http
POST /api/ApplicationLogs HTTP/1.1
Host: your-eventloomer-instance.com
Content-Type: application/json
X-API-Key: YOUR_TEAM_API_KEY
{
"uniqueIdentifier": "YOUR_PROJECT_GUID_STRING",
"categoryName": "MyApp.Services.NotificationService",
"message": "Notification sent to user@example.com",
"level": "Information",
"correlationKey": "req-xyz-789",
"environment": "Staging",
"scopeData": { "userId": "u-567", "notificationType": "Email" }
}
Response Handling:
Both endpoints return HTTP 200 OK
. Crucially, check the success
field in the JSON response body to confirm if the log was accepted. See the API Reference for full request/response details and error codes.
3. Viewing Your Logs
Once logs are successfully sent, navigate to your EventLoomer dashboard:
- Logs sent to
/api/ExternalLogs
appear in the Event Logs and Event Flow views (if correlated). - Logs sent to
/api/ApplicationLogs
appear in the Application Logs view for the specified Project.
4. Integrating with the .NET SDK (Specific Instructions)
If you are using .NET, our SDK simplifies integration, especially with Microsoft.Extensions.Logging
.
Installation
bash
dotnet add package EventLoomer.SDK
Configuration (Program.cs
/ Startup.cs
)
csharp
// Required usings:
using EventLoomer.SDK;
using Microsoft.Extensions.Logging;
// Inside your service configuration:
builder.Services.AddEventLoomer(options =>
{
options.BaseUrl = builder.Configuration["EventLoomer:BaseUrl"] ?? "YOUR_EVENTLOOMER_API_URL";
options.ApiKey = builder.Configuration["EventLoomer:ApiKey"] ?? "YOUR_TEAM_API_KEY"; // Team API Key
options.ProjectId = builder.Configuration["EventLoomer:ProjectId"] ?? "YOUR_PROJECT_ID"; // Required for ILogger
options.Environment = builder.Configuration["EventLoomer:Environment"] ?? "Development"; // Optional
// options.FailSilently = true; // Optional
},
loggerConfig => // Optional ILogger specific config
{
loggerConfig.MinimumLogLevel = LogLevel.Information;
// loggerConfig.UseBatching = true; // Recommended
});
// Add EventLoomer to your logging providers
builder.Logging.AddEventLoomer();
Usage
a) ILogger
Integration (Sends Application Logs):
Inject ILogger<T>
and log as usual. Logs go to the configured ProjectId
.
csharp
public class ExampleService
{
private readonly ILogger<ExampleService> _logger;
public ExampleService(ILogger<ExampleService> logger) { _logger = logger; }
public void RunTask(string taskId)
{
using (_logger.BeginScope(new Dictionary<string, object>{ ["TaskId"] = taskId }))
{
_logger.LogInformation("Starting task {TaskId}", taskId);
// ...
_logger.LogWarning("Task {TaskId} encountered a delay", taskId);
}
}
}
b) IEventLoomerClient
(Sends Event/Step or Application Logs):
Inject IEventLoomerClient
for manual control.
csharp
using EventLoomer.SDK;
using EventLoomer.SDK.Models; // For EventLogLevel
public class AnotherService
{
private readonly IEventLoomerClient _client;
public AnotherService(IEventLoomerClient client) { _client = client; }
public async Task LogStep(string stepId, string data, string corrId, string env)
{
// Send log associated with a specific Event/Step (External Log)
var response = await _client.InfoAsync(stepId, data, corrId, env);
if(!response.Success) { /* Handle error */ }
}
public async Task LogAppDiagnostic(string projectId, string msg, string corrId, string env)
{
// Send log associated with a Project (Application Log)
var response = await _client.SendApplicationLogAsync(
projectId, "MyCategory", 500, "DiagnosticEvent", msg, EventLogLevel.Debug,
correlationKey: corrId, environment: env
);
if(!response.Success) { /* Handle error */ }
}
}
Next Steps
- Dive deeper into the SDK Usage guide (if using .NET).
- Consult the API Reference for detailed endpoint specifications.
- Review the Best Practices for effective logging strategies.