Difference between revisions of "Admins:LogSystem"

Line 1: Line 1:
 
{{PageHeaderChild|Admins|Log System}}
 
{{PageHeaderChild|Admins|Log System}}
 
<br/>
 
<br/>
== EQ2Emulator: Log System ==
 
 
The 'log_config.xml' file is the '''optional''' Log System configuration file for EQ2Emulator Server. All loggers have default settings defined in the code (LogTypes.h) and this file is used to override those defaults without having to recompile the code.
 
The 'log_config.xml' file is the '''optional''' Log System configuration file for EQ2Emulator Server. All loggers have default settings defined in the code (LogTypes.h) and this file is used to override those defaults without having to recompile the code.
  

Revision as of 13:32, 3 August 2015

Admins - Log System

Return to: Admins | Tutorials | Portal | Forum | Project Manager | Bug Tracker


The 'log_config.xml' file is the optional Log System configuration file for EQ2Emulator Server. All loggers have default settings defined in the code (LogTypes.h) and this file is used to override those defaults without having to recompile the code.


Scatman has implemented "log queuing" functionality for our very active Log System. The problem was, so many logs were being written at the same time, they started to inject over each other making the logs unreadable. Now, logs are handled as FIFO - First In, First Out. The system is undergoing extensive testing, but for now performs wonderfully with the addition of the "Level" parameter as well.


The LogWrite system consists of these elements:

 LogWrite(CATEGORY__TYPE, Level, "Tag", "Formatted Text", params);


Categories

This is the list of current CATEGORIES available:

System Loggers

 WORLD
 LOGIN
 PATCHER
 PARSER
 INIT
 DATABASE
 MUTEX
 MISC


Network Loggers

 CCLIENT
 NET
 OPCODE
 PACKET


Player Loggers

 PLAYER


SubSystem Loggers

 CHAT
 COLLECTIONS
 COMBAT
 COMMAND
 FACTION
 GUILD
 ITEM
 LOOT
 LUA
 MERCHANT
 NPC
 NPC_AI
 QUEST
 RECIPES
 RULES
 SKILLS
 SPELLS
 TRADESKILLS


Spawn Loggers

 SPAWN
 OBJECT
 SIGN
 WIDGET
 GROUNDSPAWN


Zone Loggers

 ZONE
 INSTANCE


Types

All CATEGORIES have 7 TYPES, with some categories having a few extra as needed:

 INFO
 WARNING
 ERROR
 DEBUG
 PACKET
 DETAIL
 DATA


Level

The "Level" parameter tells the logger how much detail you wish to see in your debugging of a particular logger. Valid range is 0 (minimal) through 9 (maximum).

Examples:

 Default Level 0: Displays only the minumum amount of debugging for an event - Ie., Loading Items...
         Level 3: Might show Items loading, and display each TYPE of item loaded and it's counts
         Level 9: Might show each and every item loading with all of it's possible values (not advised)		


Color

The "Color" parameter allows you to set your own color for the log entry (restricted to defined colors in code)

 White/WhiteBold
 Yellow/YellowBold
 Red/RedBold
 Green/GreenBold
 Blue/BlueBold
 Cyan/CyanBold
 Magenta/MagentaBold


Enabled

The "Enabled" parameter allows you to toggle the logger on or off without removing the entry from log_config.xml


Logs

The "Logs" parameter lets you direct the logger to one of 3 outputs, or any combination of the 3 (bitwise):

 1 = Log File (logs folder under EQ2World.exe folder)
 2 = Console
 4 = Client (not currently implemented)

Examples:

 To direct logger output to both File and Console, Logs="3"
 To direct logger output to just Console, Logs="2"
 To direct logger output to just File, Logs="1"


Example

Example LogConfig (you can use any 1 TYPE definition, you do not need them all, but the XML must be formatted as follows):

 <LogConfig Category="WORLD">
   <ConfigType Type="DEBUG" Level="0" Color="GreenBold" Enabled="True" Logs="3" />
   <ConfigType Type="DATA" Level="5" Color="White" Enabled="True" Logs="1" />
 </LogConfig>

This example overrides the default WORLD category, DEBUG and DATA types, to write to the console and/or just the log file.