Difference between revisions of "Admins:LogSystem"

 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== EQ2Emulator: Log System ==
+
{{PageHeaderChild|Admins|Log System}}
 +
<br/>
 
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.
  
Line 10: Line 11:
  
  
=== Categories ===
+
{{Header|Categories|BackgroundColor=3d78b4|FontColor=ffffff}}
 
This is the list of current CATEGORIES available:
 
This is the list of current CATEGORIES available:
  
==== System Loggers ====
+
{|style="table-layout:fixed; width: 100%;"
  WORLD
+
|{{TextBox|System Loggers|WORLD<br/>LOGIN<br/>PATCHER<br/>PARSER<br/>INIT<br/>DATABASE<br/>MUTEX<br/>MISC|BackgroundColor=ffffff|FontColor=000}}
  LOGIN
 
  PATCHER
 
  PARSER
 
  INIT
 
  DATABASE
 
  MUTEX
 
  MISC
 
  
==== Network Loggers ====
+
{|style="table-layout:fixed; width: 100%;"
  CCLIENT
+
|{{TextBox|Network Loggers|CCLIENT<br/>NET<br/>OPCODE<br/>PACKET|BackgroundColor=ffffff|FontColor=000}}
  NET
 
  OPCODE
 
  PACKET
 
  
==== Player Loggers ====
+
{|style="table-layout:fixed; width: 100%;"
  PLAYER
+
|{{TextBox|Player Loggers|PLAYER|BackgroundColor=ffffff|FontColor=000}}
  
==== SubSystem Loggers ====
+
{|style="table-layout:fixed; width: 100%;"
  CHAT
+
|{{TextBox|SubSystem Loggers|CHAT<br/>COLLECTIONS<br/>COMBAT<br/>COMMAND<br/>FACTION<br/>GUILD<br/>ITEM<br/>LOOT<br/>LUA<br/>MERCHANT<br/>NPC<br/>NPC_AI<br/>QUEST<br/>RECIPES<br/>RULES<br/>SKILLS<br/>SPELLS<br/>TRADESKILLS|BackgroundColor=ffffff|FontColor=000}}
  COLLECTIONS
 
  COMBAT
 
  COMMAND
 
  FACTION
 
  GUILD
 
  ITEM
 
  LOOT
 
  LUA
 
  MERCHANT
 
  NPC
 
  NPC_AI
 
  QUEST
 
  RECIPES
 
  RULES
 
  SKILLS
 
  SPELLS
 
  TRADESKILLS
 
  
==== Spawn Loggers ====
+
{|style="table-layout:fixed; width: 100%;"
  SPAWN
+
|{{TextBox|Spawn Loggers|SPAWN<br/>OBJECT<br/>SIGN<br/>WIDGET<br/>GROUNDSPAWN|BackgroundColor=ffffff|FontColor=000}}
  OBJECT
 
  SIGN
 
  WIDGET
 
  GROUNDSPAWN
 
  
==== Zone Loggers ====
+
{|style="table-layout:fixed; width: 100%;"
  ZONE
+
|{{TextBox|Zone Loggers|ZONE<br/>INSTANCE|BackgroundColor=ffffff|FontColor=000}}
  INSTANCE
 
  
  
=== Types ===
+
{{Header|Types|BackgroundColor=3d78b4|FontColor=ffffff}}
 
All CATEGORIES have 7 TYPES, with some categories having a few extra as needed:
 
All CATEGORIES have 7 TYPES, with some categories having a few extra as needed:
  
Line 76: Line 45:
  
  
=== Level ===
+
{{Header|Level|BackgroundColor=3d78b4|FontColor=ffffff}}
 
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).
 
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).
 
 
Line 85: Line 54:
  
  
=== Color ===
+
{{Header|Color|BackgroundColor=3d78b4|FontColor=ffffff}}
 
The "Color" parameter allows you to set your own color for the log entry (restricted to defined colors in code)
 
The "Color" parameter allows you to set your own color for the log entry (restricted to defined colors in code)
  
Line 97: Line 66:
  
  
=== Enabled ===
+
{{Header|Enabled|BackgroundColor=3d78b4|FontColor=ffffff}}
 
The "Enabled" parameter allows you to toggle the logger on or off without removing the entry from log_config.xml
 
The "Enabled" parameter allows you to toggle the logger on or off without removing the entry from log_config.xml
  
=== Logs ===
+
 
 +
{{Header|Logs|BackgroundColor=3d78b4|FontColor=ffffff}}
 
The "Logs" parameter lets you direct the logger to one of 3 outputs, or any combination of the 3 (bitwise):
 
The "Logs" parameter lets you direct the logger to one of 3 outputs, or any combination of the 3 (bitwise):
  
Line 112: Line 82:
 
   To direct logger output to just File, Logs="1"
 
   To direct logger output to just File, Logs="1"
  
=== Example ===
+
 
 +
{{Header|Example|BackgroundColor=3d78b4|FontColor=ffffff}}
 
Example LogConfig (you can use any 1 TYPE definition, you do not need them all, but the XML must be formatted as follows):
 
Example LogConfig (you can use any 1 TYPE definition, you do not need them all, but the XML must be formatted as follows):
  

Latest revision as of 18:23, 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.