Brazil's biggest MU Online portal — since 2003
Tutorial Intermediate Tutoriais

How to Monitor MU Online Server Logs in Real Time

Learn to monitor MU Online server logs in real time using native Windows tools, batch scripts, and SQL queries to diagnose errors and track player activity quickly.

VI ViciadosMU Team · Updated on 3 jul 2026 · ⏱ 12 min read

Keeping a MU Online private server stable requires constant visibility into what is happening at the process and database level. Without proper log monitoring, a crash, an exploit attempt, or a performance degradation can go unnoticed for hours. This tutorial covers reading log files in real time, automating error alerts with batch scripts, and querying SQL Server for player activity logs.

Why Log Monitoring Matters

MuServer generates logs in two separate layers, each serving a different purpose:

  • Text log files: runtime process events, memory errors, map loading failures, and network errors
  • SQL Server tables: player action history, item transactions, connections, GM command records

Monitoring only one layer leaves blind spots. A GameServer crash may appear in Error.log before it shows up in the database, while item duplication attempts are only recorded in SQL tables.

Part 1 — MuServer Log File Structure

1.1 Default Log Directory Layout

The standard MuServer Season 6 installation organizes logs as follows:

MuServer/
├── GameServer/
│   └── Log/
│       ├── GameServer.log        ← general process events
│       ├── Error.log             ← critical errors and exceptions
│       ├── ServerInfo.log        ← connection and handshake records
│       └── GMCommand.log         ← GM commands executed in-game
├── ConnectServer/
│   └── Log/
│       ├── ConnectServer.log     ← connection attempts to the CS
│       └── Error.log
├── DataServer/
│   └── Log/
│       └── DataServer.log        ← database synchronization events
└── EventServer/
    └── Log/
        └── EventServer.log       ← event logs (Blood Castle, Devil Square, etc.)
Nota: In MuServer builds for Season 9 and later, GameServer logs may be split by channel: GameServer01.log, GameServer02.log, and so on, inside per-server subfolders. Adjust your monitoring paths accordingly.

1.2 Verifying Log Configuration

Before setting up monitoring, confirm logging is enabled. Open GameServer/GameServer.ini and check the log section:

[Log]
LogSave=1
LogType=3
LogPath=./Log/
MaxLogFileSize=10240

Key parameters:

  • LogSave=1 — enables writing to file (0 disables logging entirely)
  • LogType=3 — verbosity level (1=errors only, 2=warnings+errors, 3=informational, 4=debug)
  • MaxLogFileSize=10240 — maximum file size in KB before the log rotates (10 MB)
Atenção: Setting LogType=4 in a production environment can generate hundreds of megabytes of log data per day, causing disk I/O overhead that affects server performance. Use debug logging only during active troubleshooting sessions.

Part 2 — Real-Time Monitoring with Windows Tools

2.1 PowerShell — Fastest Method, No Installation Required

Step 1 — Open PowerShell as Administrator.

Step 2 — Tail the GameServer log in real time:

Get-Content -Path "C:\MuServer\GameServer\Log\GameServer.log" -Wait -Tail 100

Step 3 — Filter only error-related lines to reduce noise:

Get-Content -Path "C:\MuServer\GameServer\Log\GameServer.log" -Wait -Tail 100 |
  Where-Object { $_ -match "Error|FAIL|Critical|Exception" }

Step 4 — Monitor multiple logs simultaneously by creating C:\MuServer\Tools\monitor_logs.ps1:

$logs = @(
    "C:\MuServer\GameServer\Log\GameServer.log",
    "C:\MuServer\ConnectServer\Log\ConnectServer.log",
    "C:\MuServer\DataServer\Log\DataServer.log"
)

$jobs = foreach ($log in $logs) {
    Start-Job -ScriptBlock {
        param($path)
        Get-Content -Path $path -Wait -Tail 50
    } -ArgumentList $log
}

while ($true) {
    foreach ($job in $jobs) {
        Receive-Job -Job $job | ForEach-Object {
            Write-Host "[$(Split-Path $job.Name -Leaf)] $_" -ForegroundColor Cyan
        }
    }
    Start-Sleep -Milliseconds 500
}

Run this script in a dedicated PowerShell window to see all three log streams color-coded in a single console.

2.2 Batch Script for Automated Error Alerts

Create C:\MuServer\Tools\error_alert.bat to check for critical errors every 60 seconds:

@echo off
:loop
findstr /I "Critical Error Exception FAIL" "C:\MuServer\GameServer\Log\Error.log" > "%TEMP%\mu_errors.txt"
for %%A in ("%TEMP%\mu_errors.txt") do if %%~zA GTR 0 (
    echo [%DATE% %TIME%] ERRORS DETECTED - Check Error.log immediately
    type "%TEMP%\mu_errors.txt"
)
timeout /t 60 /nobreak > nul
goto loop
Dica: Register this script as a Windows Scheduled Task set to trigger at system startup. Configure it to run with elevated privileges so it can access all log directories regardless of file permissions.

Part 3 — SQL Server Log Monitoring

3.1 Key Log Tables in MuOnline Database

MuServer records player actions in the MuOnline database. The most useful tables for real-time monitoring are:

TableContents
LOG_ConnectMemberPlayer logins and logouts
LOG_DropItemItems dropped on the ground
LOG_PickupItemItems picked up by players
LOG_TradeItemTrades between players
LOG_WareHouseItemWarehouse deposits and withdrawals
LOG_GMCommandAll GM commands executed in-game

3.2 SQL Queries for Real-Time Monitoring

Connections in the last hour:

SELECT
    TOP 50
    sID        AS AccountID,
    sCharName  AS Character,
    sIP        AS IPAddress,
    sDate      AS DateTime,
    sType      AS Action  -- 0=login, 1=logout
FROM MuOnline..LOG_ConnectMember
WHERE sDate >= DATEADD(HOUR, -1, GETDATE())
ORDER BY sDate DESC;

Currently online players with map position:

SELECT
    a.memb_guid,
    a.memb___id AS Account,
    c.Name      AS Character,
    c.MapNumber AS Map,
    c.MapPosX,
    c.MapPosY,
    a.ConnectStat
FROM MuOnline..MEMB_INFO a
INNER JOIN MuOnline..Character c ON a.memb___id = c.AccountID
WHERE a.ConnectStat = 1
ORDER BY a.memb_guid;

Recent high-volume warehouse activity (potential item stacking exploit):

SELECT TOP 20
    sID        AS Account,
    sCharName  AS Character,
    sItemName  AS Item,
    sItemCount AS Quantity,
    sDate      AS DateTime
FROM MuOnline..LOG_WareHouseItem
WHERE sDate >= CAST(GETDATE() AS DATE)
  AND sItemCount > 50
ORDER BY sDate DESC;
Nota: If the log tables do not exist in your database, check that SQLLog=1 is set in GameServer/GameServer.ini and that the table creation scripts were executed during the original MuServer installation. These scripts are typically found in the SQL/ folder of your server package.

3.3 Server Status Dashboard View

Create a consolidated SQL view to check overall server health at a glance:

USE MuOnline;
GO

CREATE VIEW vw_ServerStatus AS
SELECT
    (SELECT COUNT(*) FROM MEMB_INFO WHERE ConnectStat = 1)   AS PlayersOnline,
    (SELECT COUNT(*) FROM Character WHERE CtlCode > 0)        AS GMsOnline,
    (SELECT MAX(sDate) FROM LOG_ConnectMember)                 AS LastLoginTime,
    (SELECT COUNT(*) FROM LOG_ConnectMember
     WHERE sDate >= CAST(GETDATE() AS DATE) AND sType = 0)    AS LoginsToday,
    GETDATE()                                                  AS CheckedAt;
GO

-- Query this view every 30 seconds in SSMS to track server health:
SELECT * FROM vw_ServerStatus;

Part 4 — Log Rotation and Cleanup

4.1 Automatic Log Rotation Script

Old log files accumulate quickly. Create C:\MuServer\Tools\rotate_logs.bat to archive logs older than 7 days:

@echo off
set LOG_DIR=C:\MuServer\GameServer\Log
set ARCHIVE_DIR=C:\MuServer\GameServer\Log\Archive
set DATE_TAG=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%

if not exist "%ARCHIVE_DIR%" mkdir "%ARCHIVE_DIR%"

:: Move log files older than 7 days to the archive folder
forfiles /p "%LOG_DIR%" /m *.log /d -7 /c "cmd /c move @path %ARCHIVE_DIR%\@fname_%DATE_TAG%@ext"

echo [%DATE% %TIME%] Log rotation completed.

4.2 SQL Log Cleanup to Reclaim Disk Space

-- Keep only the last 30 days of connection logs
DELETE FROM MuOnline..LOG_ConnectMember
WHERE sDate < DATEADD(DAY, -30, GETDATE());

-- Keep only the last 15 days of item logs
DELETE FROM MuOnline..LOG_DropItem
WHERE sDate < DATEADD(DAY, -15, GETDATE());

DELETE FROM MuOnline..LOG_PickupItem
WHERE sDate < DATEADD(DAY, -15, GETDATE());

-- Check how much space was recovered
EXEC sp_spaceused 'LOG_ConnectMember';
Atenção: Always back up log tables before running bulk DELETE operations. Use SELECT INTO to create a backup copy first: SELECT * INTO MuOnline..LOG_ConnectMember_bkp FROM MuOnline..LOG_ConnectMember WHERE sDate < DATEADD(DAY, -30, GETDATE()).

Troubleshooting Common Log Issues

Log file stopped updating: The file likely reached the MaxLogFileSize limit. Rename the current file to GameServer_old.log — the server will create a new one automatically without requiring a restart.

DataServer.log showing frequent timeout errors: Check the connection string in DataServer/DataServer.ini under the DBConnString parameter. Repeated timeouts indicate a network issue between the game server host and the SQL Server instance, or severe index fragmentation in the database. Run DBCC INDEXDEFRAG(MuOnline) to rebuild indexes.

ConnectServer.log showing continuous reconnection cycles: This typically means the ServerList.dat in the GameServer directory contains a stale IP for the ConnectServer, or the ServerAddr parameter in ConnectServer/ConnectServer.ini does not match the actual network interface the process is bound to.

Dica: Configure SQL Server Agent to send email alerts when online player count drops below a threshold — a sudden drop from, say, 50 to 0 players almost always means the GameServer process crashed, letting you act before players start complaining.

Perguntas frequentes

Where are the GameServer log files located?

GameServer logs are stored in GameServer/Log/, with separate files per category: GameServer.log (general runtime events), Error.log (critical errors and exceptions), and ServerInfo.log (connection handshakes). Some Season 6 builds also generate a ConnectLog/ subfolder inside that directory.

How do I monitor multiple log files simultaneously on Windows?

Use PowerShell with Get-Content -Path 'GameServer/Log/GameServer.log' -Wait -Tail 50 in multiple windows at once, or use the free tool mTail to open several files in separate tabs with automatic live updates.

The GameServer log file is not being created — what could cause this?

Check whether GameServer/GameServer.ini has LogSave=1 enabled. In some MuServer builds the log file is only created if the GameServer/Log/ directory already exists — create it manually if missing, then restart the GameServer process.

How do I filter only player connection errors from SQL logs?

Run SELECT TOP 100 * FROM MuOnline..LOG_ConnectMember WHERE sDate >= CAST(GETDATE() AS DATE) ORDER BY sDate DESC in SQL Server Management Studio to view today's connection records sorted by most recent first.

VI

ViciadosMU Team

Equipe editorial do ViciadosMU — portal de MU Online no ar desde 2003.

Keep reading

Related articles