Skip to main content

Edge Device Logs

Collect and analyze logs from your edge devices - POS terminals, IoT devices, kiosks, and any system running outside your main infrastructure.

Overview

Edge Device Logs provides:

  • Centralized logging - Aggregate logs from distributed devices in one place
  • Error grouping - Sentry-style fingerprinting to group similar errors
  • Full-text search - Search across all log messages instantly
  • Device management - Track device health and status
  • Email alerts - Get notified when errors spike

Quick Start

1. Register a Device

curl -X POST https://api.simplr-ai.com/v1/edge/devices/register \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"device_id": "pos-terminal-001",
"device_type": "pos",
"name": "Store #42 - Register 1",
"location": {
"name": "Downtown Store",
"address": "123 Main St"
}
}'

2. Send Logs

curl -X POST https://api.simplr-ai.com/v1/edge/logs \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"logs": [
{
"device_id": "pos-terminal-001",
"level": "info",
"message": "Transaction completed successfully",
"data": {
"transaction_id": "txn_123",
"amount": 49.99
}
},
{
"device_id": "pos-terminal-001",
"level": "error",
"message": "Payment gateway timeout",
"error": {
"type": "TimeoutError",
"code": "GATEWAY_TIMEOUT"
}
}
]
}'

Log Levels

LevelDescription
debugDetailed debugging information
infoGeneral operational messages
warnWarning conditions
errorError conditions
fatalCritical errors requiring immediate attention

Log Categories

CategoryUse Case
applicationApplication-level logs
systemSystem/OS level events
securitySecurity-related events
performancePerformance metrics
networkNetwork-related events
hardwareHardware status/errors
transactionBusiness transactions
auditAudit trail events

Log Schema

interface EdgeLog {
device_id: string; // Required - unique device identifier
level: LogLevel; // Required - debug, info, warn, error, fatal
message: string; // Required - log message

// Optional fields
timestamp?: number | string; // ISO date or Unix timestamp (defaults to now)
category?: LogCategory; // Log category
environment?: string; // e.g., "production", "staging"

// Error details (for error/fatal levels)
error?: {
type: string; // Error class/type
stack?: string; // Stack trace
code?: string; // Error code
cause?: string; // Root cause
};

// Custom data - store any JSON
data?: Record<string, unknown>;

// Distributed tracing
trace_id?: string;
span_id?: string;

// Source location
source_file?: string;
source_line?: number;
source_function?: string;

// Tagging
tags?: string[];
}

Error Grouping

Similar errors are automatically grouped using fingerprinting. The fingerprint is generated from:

  • Error type
  • Normalized message (with variables like IDs, timestamps removed)

This means Payment failed for order 12345 and Payment failed for order 67890 are grouped together.

View error groups in the dashboard or via API:

curl https://api.simplr-ai.com/v1/edge/errors?org_id=YOUR_ORG_ID \
-H "Authorization: Bearer YOUR_TOKEN"

Device Types

TypeDescription
posPoint of Sale terminal
kioskSelf-service kiosk
iotIoT sensor/device
mobileMobile device
desktopDesktop application
serverEdge server
gatewayNetwork gateway
otherOther device type

Pricing

Edge logs use volume-based pricing with automatic discounts at scale:

Monthly VolumeCredits per 1,000 logs
0 - 10,0001.0
10,001 - 100,0000.8
100,001 - 1,000,0000.5
1,000,000+0.3

Included features:

  • Error grouping & fingerprinting
  • Full-text log search
  • Device management
  • Basic email alerts
  • Dashboard analytics
  • 30-day retention

Best Practices

Batch Your Logs

Send logs in batches rather than individually to reduce API calls:

// Good - batch multiple logs
const logs = [];
logs.push({ device_id: "pos-001", level: "info", message: "Event 1" });
logs.push({ device_id: "pos-001", level: "info", message: "Event 2" });
await fetch("/v1/edge/logs", {
method: "POST",
body: JSON.stringify({ logs })
});

Use Structured Data

Put variable data in the data field, not the message:

// Good - structured
{
message: "Transaction completed",
data: { transaction_id: "txn_123", amount: 49.99 }
}

// Bad - unstructured
{
message: "Transaction txn_123 completed for $49.99"
}

Include Trace IDs

For distributed systems, include trace IDs to correlate logs:

{
device_id: "pos-001",
level: "info",
message: "Processing payment",
trace_id: "abc123",
span_id: "def456"
}

API Reference

EndpointMethodDescription
/v1/edge/logsPOSTIngest logs (batch)
/v1/edge/logsGETQuery logs
/v1/edge/logs/searchGETFull-text search
/v1/edge/devices/registerPOSTRegister device
/v1/edge/devicesGETList devices
/v1/edge/devices/:id/heartbeatPOSTDevice heartbeat
/v1/edge/overviewGETDashboard stats
/v1/edge/errorsGETError groups
/v1/edge/trendsGETLog volume trends
/v1/edge/alertsGET/POST/DELETEManage alerts