
You are viewing a potentially older version of this package. View Latest Version

Pipes all BepInEx log output to a Discord webhook in near-real-time, with local buffering so no lines are lost on unexpected process death.
Every log line
│
▼
BepInEx/DiscordLogBuffer.txt ← flushed to disk immediately, every line
│
▼ (every N seconds, background thread)
Discord Webhook POST
│
├─ read from front of buffer
├─── success (200) → remove read lines from front.
└─── failure (500) → leave buffer, retry next tick
On next startup:
buffer file exists? → send as "recovered from crash" → delete → begin fresh
Requirements: .NET SDK with netstandard2.1 support (i.e. .NET Core 3.0+ or .NET 5+ SDK), dotnet CLI, Valheim dedicated server + BepInEx installed.
Targets
netstandard2.1, which runs on Unity's Mono 6.4+ runtime. Not compatible with plain .NET Framework 4.7.2.
The .csproj assumes the default Linux Steam dedicated server path:
~/.steam/steam/steamapps/common/Valheim dedicated server
Edit the <ValheimDir> property if your path differs.
dotnet build -c Release
Output: bin/Release/netstandard2.1/DiscordLogger.dll
DiscordLogger.dll into BepInEx/plugins/BepInEx/config/com.byawn.DiscordLogSync.cfg[Discord]
WebhookUrl = https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN
SendIntervalSeconds = 3
MaxMessageChars = 1800
| Key | Default | Description |
|---|---|---|
WebhookUrl |
(empty) | Required. Discord webhook URL. |
SendIntervalSeconds |
3 |
How often to flush buffer to Discord. Minimum 2. |
MaxMessageChars |
1800 |
Characters per embed. |
BepInEx/DiscordLogBuffer.txt
| Situation | Color |
|---|---|
Contains [Fatal] or [Error] |
🔴 Red |
Contains [Warning] |
🟠 Orange |
| Recovery (crash) | 🟣 Purple |
| Normal | 🔵 Blue |