AzerothCore全聊天记录文件日志功能启用及配置失效问题求助
I’ve run into this exact issue before when migrating to AzerothCore’s updated logging system—let’s break down what’s likely going wrong and how to fix it:
1. Fix Appender Configuration Format & Parameters
Your current Appender line has a few critical issues:
- Level Mismatch: The second parameter is the log level threshold. You set it to
4(which maps toERROR), but chat messages are logged atINFO(level2) or lower. This means only rare error-level chat events would be captured, if any. - File Path Clarity: Without specifying a directory like
logs/, the file might be created in the server’s root folder instead of thelogsdirectory you’re checking. - Case Sensitivity: Appender names are case-sensitive—you used
Appender.Chat, so your Loggers need to referenceChat(uppercase C) to match.
Correct your Appender line to:
Appender.Chat=2,2,1,logs/chat_%s.log
Here’s what each parameter does:
2: FileAppender type (correct for writing to files)2: INFO level threshold (captures all standard chat messages)1: Append mode (adds new logs to the file instead of overwriting)logs/chat_%s.log: Saves to thelogssubdirectory with a date-based filename (e.g.,chat_2024-05-20.log)
2. Fix Logger Naming & Coverage
Your Loggers use lowercase chat (e.g., Logger.chat.log), but they need to match the uppercase Chat Appender name. You’re also missing key chat categories that cover all message types. Update your Logger lines to:
Logger.Chat=2,Chat Logger.Chat.Say=2,Chat Logger.Chat.Yell=2,Chat Logger.Chat.Whisper=2,Chat Logger.Chat.Guild=2,Chat Logger.Chat.Party=2,Chat Logger.Chat.Raid=2,Chat Logger.Chat.System=2,Chat
This ensures every type of chat message is routed to your Chat Appender.
3. Verify Critical Post-Configuration Steps
- Restart the World Server: Changes to
worldserver.confonly take effect after a full restart—reloading configs won’t apply logger/appender changes. - Check File Permissions: Make sure the user running
worldserverhas write permissions to thelogsdirectory. If the server can’t create the file, it won’t show up at all. - Confirm You’re Editing the Right Config: Chat logging is controlled by
worldserver.conf, notauthserver.conf—double-check you modified the correct file.
4. Test the Setup
After applying the fixes and restarting:
- Send a few test messages (say, yell, whisper to another character)
- Navigate to your server’s
logsdirectory - Look for a file named like
chat_YYYY-MM-DD.log—it should contain your test messages.
If it still doesn’t work, check the main worldserver.log for any errors related to appenders/loggers on startup—this can clue you into typos or invalid parameters.
内容的提问来源于stack exchange,提问作者lachev

