LibreAuth

Logging & Integration

Application event logs, Discord webhooks, Seller API logging, and panel Event Logs — configure in Settings and view under the Event Logs tab.

Panel path

Select an application → SettingsApp ConfigLogging & Integration card. View logs under sidebar Event Logs.

Discord events Log IP Retention Seller logs

Client logs (SDK)

Send messages from your app with API type log or SDK log(). They appear in Panel → Event Logs → Application Logs.

PHP
$app->log('User opened menu', gethostname());
// JS: await auth.Log('User opened menu');
WARN
255 character limit per message — longer text is truncated server-side. Enable Logs under Settings → Functions if disabled.

Optional parameter pcuser stores the Windows username or machine label. Enable Log IP Address in Logging settings to attach client IP to each row.

API reference: Send Log

Discord Alerts

Open the app → sidebar Discord Alerts. Add a custom webhook: name + Discord webhook URL + enabled. The URL stays on the server (Panel / Seller API). Client SDKs never embed the URL — they call login / log / alert / screenshot and the server fans out to every enabled webhook with a valid URL.

Panel opทำอะไร
discord_channelsโหลด webhooks + event catalog (auto-migrate การ์ดเก่า → custom)
discord_webhook_addสร้าง webhook (name, url)
discord_webhook_updateแก้ชื่อ / URL / enabled
discord_webhook_deleteลบ webhook
discord_screenshot_allเปิด/ปิดแนบ screenshot ทุก alert
test_discord_channelยิง test embed

Seller API — Discord Alerts

Same apps.discord_channels store as the Panel. Legacy fetchwebhooks / addwebhook (client raw POST table) is a different system.

Seller typeทำอะไร
fetchdiscordlist custom webhooks + catalog
adddiscordสร้าง webhook (name, url)
editdiscordแก้ name / url / enabled
deldiscordลบตาม id
testdiscordยิง test embed
discordshotallเปิด/ปิด screenshot-all

Reference: fetchdiscord · adddiscord · All Seller Endpoints

TIP
กด Add webhook → ตั้งชื่อ + วาง Discord webhook URL → เปิดใช้งาน — ไม่ต้องใส่ URL ใน SDK · หรือใช้ Seller adddiscord

Routing model

Custom webhook ที่ enabled + มี URL ถูกต้อง รับทุก event จากเซิร์ฟเวอร์ (Login, Log, Alert, Screenshot, security, ops …). เนื้อหา custom alert ตั้งจาก SDK ด้วย Alert(title, status, detail, category, action).

Legacy single discord_webhook + webhook_events still works until channels are saved (auto-migrated into auth).

SDK — ไม่มี Discord URL

ฝั่ง client เลือกข้อความ / status / category เอง — Discord webhook URL อยู่บน Panel หรือ Seller API เท่านั้น (RE ของ binary จะไม่เจอ URL)

C++
// 1) Panel Discord Alerts OR Seller API adddiscord — name + webhook URL + enabled
// 2) Client SDK — never put Discord URL in the binary

app.attachScreenshots = true;
app.Login(user, pass, hwid);

app.Alert("Payment cleared", "ok", "order #1042", "Billing", "payok");
app.Alert("License gate", "fail", "hwid mismatch", "Security", "hwidfail");

app.Log("Opened menu", "", "info", "ui");
app.LogError("License gate blocked", "license");
PHP
// URL is never in the SDK — configure via Panel or Seller adddiscord / editdiscord

$app->Alert('Payment cleared', 'ok', 'order #1042', 'Billing', 'payok');
$app->Log('Opened menu', gethostname(), 'info', 'ui');
$app->LogError('Payment failed', 'billing');
$app->Screenshot($jpegBytesOrBase64, 'optional note');

Alert: title (required), status = ok · fail · warn · info, optional detail / category / action. Rate limit ~2s. Stored in Event Logs as [alert] ….

Log level: info · warn · error · debug. tag: อัลฟานิวเมอริก.

Screenshot capture

Authenticated clients upload a screen capture. Enabled custom webhooks with a valid URL receive it.

API
type=screenshot
image=<base64 PNG/JPEG/WEBP, max ~1.5MB>
note=optional label

Alert API:

API
type=alert
title=required (max 120)
status=ok|fail|warn|info
detail=optional (max 500)
category=optional (default SDK)
action=optional slug

SDK: C++ Screenshot(note) auto-captures the desktop; PHP/JS Screenshot() accept image bytes or base64. Rate limit: 1 per user / 10 seconds.

Attach screenshot to every alert

Turn on Discord Alerts → Attach screenshot to every alert to have the client image ride along on every alert embed (login, wrong key, hash reject, init reject, ban, and so on) — not just the dedicated screenshot event. When the toggle is on, add a screenshot field to any request:

API
type=login
username=...
pass=...
screenshot=<base64 PNG/JPEG/WEBP, max ~1.5MB>

The mime is sniffed from the bytes (client-declared type is ignored) and anything over ~1.5MB is dropped silently — a bad or missing screenshot never blocks auth. SDK: set C++ client.attachScreenshots = true; and auth-type calls auto-capture; other SDKs send the base64 in the screenshot field of any call.

Application log storage

Toggle / fieldDB fieldEffect
Log IP Addresslog_ipStores client_ip on each log API row
Retention (days)log_retention_daysAuto-delete older logs (1–90 days, default 7) on panel fetch

Event Logs tab

Two views — same toolbar pattern as Files / Web Loader:

Features: search, export TSV, bulk delete, clear all, pagination. Yellow notice reminds you of the 255-char limit and retention policy.

Seller API logging

Enable Seller Logging in Logging & Integration (or toggle on Event Logs → Seller Logs). Successful Seller API calls that target the app are recorded with action name and IP.

Requires Seller API request to include app id or name so LibreAuth knows which application to attribute.

Seller API docs: Getting Started

webhook_events JSON

Discord event toggles are stored in apps.webhook_events as JSON:

JSON
{"login":true,"register":true,"ban":true,"license":true,"forgot":true,"log":false}

Defaults when unset: login/register/ban/license/forgot on, client log off.