Commit Graph

60 Commits

Author SHA1 Message Date
Spp
5aee9433e1 Core/Logging: Minor optimization in ShouldLog 2012-08-27 12:56:45 +02:00
Spp
a566e3e58b Core/Logging: Move more log messages to LOG_FILTER_SERVER_LOADING 2012-08-16 11:02:46 +02:00
Spp
3c42401d66 Core/Logging: Set config options to behave like old log system. 2012-08-16 00:56:58 +02:00
Spp
8a1e7dd070 Core/Loading: Re-enable Server loading log 2012-08-16 00:23:44 +02:00
Nay
ca2bc35713 Misc: CRLF to LF, whitespace cleanup and tabs to spaces 2012-08-15 21:30:55 +01:00
Spp
52a5991c12 Core/Logging: Added documentation about this system
- Restored old CharDump (LOG_FILTER_PLAYER_DUMP) but disabled by default.
- "%s" is now used to set dynamic file names, only used by GM commands and Player dump
2012-08-15 19:58:02 +02:00
Spp
b77d88ec51 Core/Logging: Fix crash on authserver shutdown
Closes #7365
Closes #7325
2012-08-15 15:59:11 +02:00
Shauren
ca0a54f357 Core/Logging: Fixed a possible crash with dynamic log file names 2012-08-09 14:31:09 +02:00
kaelima
78fdeca851 Core/Logging: Fix crash in AppenderFile deconstructor when logfile is uninitialized 2012-08-09 12:54:35 +02:00
Nay
429130522e Core/Authserver: Fix logging crash at startup 2012-08-07 04:21:58 +02:00
kandera
5aa54ca0e9 Update src/server/shared/Logging/AppenderDB.cpp
Core/Appender: fix typo
2012-08-06 13:02:11 -03:00
Spp
4a5a077b65 Core/Logging: Use prepared statements in AppenderDB 2012-08-06 13:36:34 +02:00
Spp
6d21515939 Core/Logging: Implement logging to database 2012-08-06 13:20:24 +02:00
Spp
97c4b92eb0 Core/Logging: Try to simplify configuration of loggers and appenders
Changed multiple lines to a simple format:
- Logger.name=Type,LogLevel,Flags,AppenderList
- Appender.name=Type,LogLevel,Flags,optional1,optional2
  * Type = File: optional1 = File name, optiona2 = Mode
  * Type = Console: optional1 = Colors

Created a default set of loggers and appenders.
- Root logger defaults to Error, that means you will see nothing on console by default (not even loading)
- You need to add the loggers to Loggers options if you want to enable them, otherwise Root logger will be used for all types

Restored outSQLDriver (LOG_FILTER_SQL_DRIVER), outSQLDev (LOG_FILTER_SQL_DEV), outArena (LOG_FILTER_ARENA) and outChar (LOG_FILTER_CHARACTER) functionality by creating new types (LOG_FILTER_CHARACTER is a rename of LOG_FILTER_DELETE.

Note: You need to update your config file... again (yeah sorry... trying to make it simpler)
2012-08-06 12:10:33 +02:00
Spp
5746b688fa Core/Logging: Reload Logging options when .reload config is used 2012-08-06 09:30:47 +02:00
Spp
483fb42306 Core/Logging: Move player delete logging to new type LOG_FILTER_PLAYER_DELETE (34). Also add missing sql from 55ce180f28 2012-08-06 08:49:31 +02:00
Spp
3f42094b9c Core/Logging: Add option to remove timestamp, Log Level and Log Filter Type from logged msgs
- Appender config option .Timestamp and .Backup became obsolete
- New Appender config option .Flags added

Appender Console prefixes Log Level and Log Filter Type to the logged text as default
Appender File prefixes Timestamp, Log Level and Log Filter Type to the logged text as default
2012-08-05 15:38:25 +02:00
joschiwald
af92a36e88 Core/Logging: Use config LogsDir to save log files (re-added) 2012-08-04 02:55:11 +01:00
Spp
1089102827 Add missing Copyright headers and some clarification to config files... 2012-08-03 17:29:43 +02:00
Spp
634776e0bc Fix compile under windows 2012-08-03 15:54:54 +02:00
Spp
55ce180f28 Core/Logging: Add Asyncronous logging with Loggers ("What to log") and Appenders ("Where to log") system. Will allow to select to full log some parts of core while others are not even logged.
- Logging System is asyncronous to improve performance.
- Each msg and Logger has a Log Type and Log Level assigned. Each msg is assigned the Logger of same Log Type or "root" Logger is selected if there is no Logger configured for the given Log Type
- Loggers have a list of Appenders to send the msg to. The Msg in the Logger is not sent to Appenders if the msg LogLevel is lower than Logger LogLevel.
- There are three (at the moment) types of Appenders: Console, File or DB (this is WIP, not working ATM). Msg is not written to the resource if msg LogLevel is lower than Appender LogLevel.
- Appender and Console Log levels can be changed while server is active with command '.set loglevel (a/l) name level'

Explanation of use with Sample config:

Appender.Console.Type=1       (1 = Console)
Appender.Console.Level=2      (2 = Debug)

Appender.Server.Type=2        (2 = File)
Appender.Server.Level=3       (3 = Info)
Appender.Server.File=Server.log

Appender.SQL.Type=2           (2 = File)
Appender.SQL.Level=1          (1 = Trace)
Appender.SQL.File=sql.log

Appenders=Console Server      (NOTE: SQL has not been included here... that will make core ignore the config for "SQL" as it's not in this list)

Logger.root.Type=0            (0 = Default - if it's not created by config, server will create it with LogLevel = DISABLED)
Logger.root.Level=5           (5 = Error)
Logger.root.Appenders=Console

Logger.SQL.Type=26            (26 = SQL)
Logger.SQL.Level=3            (2 = Debug)
Logger.SQL.Appenders=Console Server SQL

Logger.SomeRandomName.Type=24 (24 = Guild)
Logger.SomeRandomName.Level=5 (5 = Error)
Loggers=root SQL SomeRandomName

* At loading Appender SQL will be ignored, as it's not present on "Appenders"

* sLog->outDebug(LOG_FILTER_GUILD, "Some log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomName is found but it's LogLevel = 5 and Msg LogLevel=2... Msg is not logged

* sLog->outError(LOG_FILTER_GUILD, "Some error log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomeName is found with proper LogLevel but Logger does not have any Appenders assigned to that logger... Msg is not logged

* sLog->outDebug(LOG_FILTER_SQL, "Some msg related to SQLs")
  - Msg is sent to Logger SQL (matches type), as it matches LogLevel the msg is sent to Appenders Console, Server and SQL
    - Appender Console has lower Log Level: Msg is logged to Console
    - Appender Server has higher Log Level: Msg is not logged to file
    - Appender SQL has lower Log Level: Msg is logged to file sql.log

* sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Some msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). As Logger has higher LogLevel msg is not sent to any appender

* sLog->outError(LOG_FILTER_BATTLEGROUND, "Some error msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). Msg has lower LogLevel and is sent to Appender Console
    - Appender Console has lower LogLevel: Msg is logged to Console
2012-08-03 14:20:18 +02:00
Nay
c71f75e9ca Core/Logging: Fix a typo in DebugLogFilters - Database & AI
Thanks to Garthog for finding it
2012-03-31 15:13:56 +01:00
Gyx
5b7493fc66 Core/Misc: Code style and remove unused define.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-29 14:43:34 +08:00
leak
7309ee5621 SQL: Auth db data type cleanup logs, realmcharacters, realmlist, uptime / Storage engine switched to InnoDB Note:
As for the redundant `uptime`.`startstring` being removed, this page might be of interest how to generate time strings from unix timestamps
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime
2012-03-28 19:46:38 +02:00
leak
8e3a4b956e Core/Warden: Base implementation for Warden functionality
Note: The default config file action for clients failing the checks can be changed for each check via the characters.warden_action table

Credits to TOM_RUS
2012-02-19 13:51:16 +01:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
leak
73cf793e56 Core/DBLayer: Refactor prepared statement defines Note:
The new format for the middle section is a 3-letter upper case abbreviation of the sql command being executed (select -> SEL, update -> UPD, etc.)
{DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed}
2011-12-31 20:14:38 +01:00
leak
ef17c05dec Core/DBLayer: Convert PExecute() queries to prepared statements No. 1 2011-12-25 18:13:21 +01:00
Shauren
638693e78f Core: Fixed more warnings (C6246: Local declaration of 'x' hides declaration of the same name in outer scope.) 2011-11-23 17:55:16 +01:00
Spp
e3f8588a22 Minor changes here and there:
- Cosmetic changes
- 'Engrish fix'
- Initialization of some vars
- Remove some not needed includes
2011-10-18 14:59:23 +02:00
Spp
b16d2245bb Cosmetic: Multiple cosmetic changes
- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces

Note: Only affects files with extension "cpp" and "h" under /src/server
2011-09-29 12:43:05 +02:00
Spp
be12603150 Configuration/ConfigMgr: converted from singleton to namespace with free functions. 2011-09-28 13:00:43 +02:00
Spp
7b68a6bf69 Core/Logging: Add new function to include full stacktrace.
Note: It only has use for devs but makes it easier to get the error with a full trace
2011-09-26 14:34:50 +02:00
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
Fredi Machado
bac261b001 Core/Log: Reload log levels and filters
on 'reload config' command
2011-09-08 23:00:26 -03:00
Spp-
e47b96af3e Core: Append single character to stream as character, not as a string 2011-07-29 14:18:28 +02:00
Spp-
e9aa72cc7b Cosmetic: rename function escape_string to EscapeString 2011-06-30 14:52:44 +02:00
Shocker
6a6e3e3265 Core/Logs: Add outSQLDev log, will be used for core-generated SQL queries/dumps 2011-06-29 16:31:01 +03:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
Machiavelli
e07e20ffca Core/Log: Implement log masks for debug log level, to allow selective debug output. Update your worldserver.conf. 2011-02-20 20:16:34 +01:00
Machiavelli
957c69de83 Update copyright note for 2011.
Happy new year.
2011-01-01 15:01:13 +01:00
Shauren
928443d899 Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG--
branch : trunk
2010-12-23 23:25:44 +01:00
Spp
408fce1de6 Core: Some optimizations
- Declare some functions const
- Fix some mem leak
- Fix some resource leak
- Remove unused variables and functions
- Remove duplicate functions
- Reduce the scope of some variables
- Remove unused file

--HG--
branch : trunk
2010-12-06 02:07:53 +01:00
click
67fade84d3 Core/Commands: Enable SQL query logging by config and command )patch by leak)
Closes issue 4853.

--HG--
branch : trunk
2010-11-19 13:13:07 +01:00
click
613b81f36f REALLY fix the CRLF-crap...
--HG--
branch : trunk
2010-10-07 15:54:07 +02:00
click
f0c4241ea4 Remove the accidental additions of CRLF-crap from the header updates
--HG--
branch : trunk
2010-10-07 15:35:36 +02:00
click
8ea4b32fab Update copyright headers (following the same standard in all files = good)
--HG--
branch : trunk
2010-10-07 12:41:56 +02:00
click
bf664b7a44 Cleanup/Core: Remove whitespace and tabs
--HG--
branch : trunk
2010-09-12 01:40:27 +02:00
Machiavelli
fd1c6c5440 Core/DBLayer: Add an assert in TransactionTask::Execute to make sure valid queries are held
Core/Logging: Tiny cleanup in sLog.outSQLDriver

--HG--
branch : trunk
2010-09-04 16:06:04 +02:00
Machiavelli
39027133e4 Fix Linux build
--HG--
branch : trunk
2010-09-03 00:04:14 +02:00