feat(Core/Logging): rework logging (#4692)

* feat(Core/Logging): rework logging

* correct level for sql.sql

* del unused config options

* Correct build

* correct after merge

* whitespace

20:29:37 1. 'Player.cpp'. Replace (1)
20:29:37 2. 'ObjectMgr.cpp'. Replace (3)

* 1

* correct logging

* correct affter merge

* 1

* 2

* LOG_LEVEL_WARN

* #include "AppenderDB.h"

* 3

* 4

* 5

* 1. 'WorldSocket.cpp'. Replace (1)

* 6

* 1
This commit is contained in:
Kargatum
2021-04-17 16:20:07 +07:00
committed by GitHub
parent b2861be1cd
commit 4af4cbd3d9
246 changed files with 7413 additions and 6807 deletions

View File

@@ -69,116 +69,6 @@ BindIP = "0.0.0.0"
PidFile = ""
#
# LogLevel
# Description: Server console level of logging
# Default: 0 - (Minimum)
# 1 - (Basic)
# 2 - (Detail)
# 3 - (Full/Debug)
LogLevel = 0
#
# LogFile
# Description: Log file for main server log.
# Default: "Auth.log" - (Enabled)
# "" - (Disabled)
LogFile = "Auth.log"
#
# Debug Log Mask
# Description: Bitmask that determines which debug log output (level 3)
# will be logged.
# Possible flags:
#
# 64 - Anything related to network input/output,
# such as packet handlers and netcode logs
#
# Simply add the values together to create a bitmask.
# For more info see enum DebugLogFilters in Log.h
#
# Default: 0 (nothing)
DebugLogMask = 64
#
# SQLDriverLogFile
# Description: Log file for SQL driver events.
# Example: "AuthSQLDriver.log" - (Enabled)
# Default: "" - (Disabled)
SQLDriverLogFile = ""
#
# SQLDriverQueryLogging
# Description: Log SQL queries to the SQLDriverLogFile and console.
# Default: 0 - (Disabled, Query errors only)
# 1 - (Enabled, Full query logging - may have performance impact)
SQLDriverQueryLogging = 0
#
# LogTimestamp
# Description: Append timestamp to the server log file name.
# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
# Default: 0 - (Disabled)
# 1 - (Enabled)
LogTimestamp = 0
#
# LogFileLevel
# Description: Server file level of logging
# Default: 0 - (Minimum)
# 1 - (Basic)
# 2 - (Detail)
# 3 - (Full/Debug)
LogFileLevel = 0
#
# LogColors
# Description: Colors for log messages (Format: "normal basic detail debug").
# Colors: 0 - Black
# 1 - Red
# 2 - Green
# 3 - Brown
# 4 - Blue
# 5 - Magenta
# 6 - Cyan
# 7 - Grey
# 8 - Yellow
# 9 - Lred
# 10 - Lgreen
# 11 - Lblue
# 12 - Lmagenta
# 13 - Lcyan
# 14 - White
# Example: "13 11 9 5" - (Enabled)
# Default: "" - (Disabled)
LogColors = ""
#
# EnableLogDB
# Description: Write log messages to database (LogDatabaseInfo).
# Default: 0 - (Disabled)
# 1 - (Enabled)
EnableLogDB = 0
#
# DBLogLevel
# Description: Log level of databases logging.
# Default: 1 - (Basic)
# 0 - (Minimum)
# 2 - (Detail)
# 3 - (Full/Debug)
DBLogLevel = 1
#
# UseProcessors
# Description: Processors mask for Windows and Linux based multi-processor systems.
@@ -278,3 +168,95 @@ LoginDatabase.SynchThreads = 1
#
###################################################################################################
###################################################################################################
#
# LOGGING SYSTEM SETTINGS
#
# Appender config values: Given an appender "name"
# Appender.name
# Description: Defines 'where to log'
# Format: Type,LogLevel,Flags,optional1,optional2,optional3
#
# Type
# 0 - (None)
# 1 - (Console)
# 2 - (File)
# 3 - (DB)
#
# LogLevel
# 0 - (Disabled)
# 1 - (Fatal)
# 2 - (Error)
# 3 - (Warning)
# 4 - (Info)
# 5 - (Debug)
# 6 - (Trace)
#
# Flags:
# 0 - None
# 1 - Prefix Timestamp to the text
# 2 - Prefix Log Level to the text
# 4 - Prefix Log Filter type to the text
# 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS (Only used with Type = 2)
# 16 - Make a backup of existing file before overwrite (Only used with Mode = w)
#
# Colors (read as optional1 if Type = Console)
# Format: "fatal error warn info debug trace"
# 0 - BLACK
# 1 - RED
# 2 - GREEN
# 3 - BROWN
# 4 - BLUE
# 5 - MAGENTA
# 6 - CYAN
# 7 - GREY
# 8 - YELLOW
# 9 - LRED
# 10 - LGREEN
# 11 - LBLUE
# 12 - LMAGENTA
# 13 - LCYAN
# 14 - WHITE
# Example: "1 9 3 6 5 8"
#
# File: Name of the file (read as optional1 if Type = File)
# Allows to use one "%s" to create dynamic files
#
# Mode: Mode to open the file (read as optional2 if Type = File)
# a - (Append)
# w - (Overwrite)
#
# MaxFileSize: Maximum file size of the log file before creating a new log file
# (read as optional3 if Type = File)
# Size is measured in bytes expressed in a 64-bit unsigned integer.
# Maximum value is 4294967295 (4 GB). Leave blank for no limit.
# NOTE: Does not work with dynamic filenames.
# Example: 536870912 (512 MB)
#
Appender.Console=1,5,0,"1 9 3 6 5 8"
Appender.Auth=2,5,0,Auth.log,w
# Logger config values: Given a logger "name"
# Logger.name
# Description: Defines 'What to log'
# Format: LogLevel,AppenderList
#
# LogLevel
# 0 - (Disabled)
# 1 - (Fatal)
# 2 - (Error)
# 3 - (Warning)
# 4 - (Info)
# 5 - (Debug)
# 6 - (Trace)
#
# AppenderList: List of appenders linked to logger
# (Using spaces as separator).
#
Logger.root=5,Console Auth
#
###################################################################################################