76de8f3758
log manager now spreads log writings 'down' so that LOGFILE_ERROR logs are duplicated in LOGFILE_MESSAGE, and in LOGFILE_TRACE, and LOGFILE_MESSAGE logs are duplicated in LOGFILE_TRACE.
2013-08-20 10:43:54 +03:00
a5dd900acb
Added test cases for speading log messages
2013-08-19 12:58:36 +03:00
4e63df8df8
Disabled spreading of log writes temporarily.
2013-08-19 11:31:53 +03:00
c2743e7543
Logfiles are ordered by their id as follows:
...
LOGFILE_ERROR = 1
LOGFILE_MESSAGE = 2
LOGFILE_TRACE = 4
What is written to file n, will be written to all files m, m>n. Applies to user log writes. Some internal messages are such that they apply to one specific file, such as enable/disable notifications.
2013-08-19 10:28:28 +03:00
4360ae16b8
Moved timestamp string creation to skygw_utils where it can be provide service for others too.
2013-08-12 13:09:29 +03:00
43fb6b87f1
Enabled trace log in DEBUG=Y builds. Modified testlog-c accordingly.
2013-08-09 10:01:34 +03:00
0ad25ba3ab
Added functions skygw_log_enable(logfile_id_t) and skygw_log_disable(logfile_id_t) to Log manager API. By calling them log writing to any of predefined log files can be switched on or off.
...
Added simple test to testlog.c
2013-08-08 23:38:00 +03:00
234b8c40a3
Cleaned up some debug printings (to stdout).
2013-08-05 18:15:41 +03:00
b852079631
Enabled debug assertions for DEBUG=Y builds. Fixed one debug assertion in log manager.
2013-08-05 17:47:21 +03:00
ee68633c22
Removed unnecessary line
2013-08-05 10:25:45 +03:00
cae4d38a7e
Removed unnecessary argument from log manager commands because it is not used and it is always NULL.
2013-08-04 23:30:47 +03:00
9fb072ea74
Changed log manager APChanged log manager APII
2013-08-04 23:14:48 +03:00
d2efbcf867
Changed log manager API. Removed unnecessary memory context pointer (always NULL):
...
bool skygw_logmanager_init(void** buf, int argc, char* argv[]) >>
bool skygw_logmanager_init(int argc, char* argv[])
void skygw_logmanager_done(void** buf) >>
void skygw_logmanager_done(void)
void skygw_log_done(void* writebuf) >>
void skygw_log_done(void)
int skygw_log_write(void* writebuf, logfile_id_t id, char* format, ...) >>
int skygw_log_write(logfile_id_t id, char* format, ...)
int skygw_log_write_flush(void* writebuf, logfile_id_t id, char* format, ...) >>
int skygw_log_write_flush(logfile_id_t id, char* format, ...)
--- static functions :
static bool logmanager_init_nomutex(void** p_ctx, int argc, char* argv[]) >>
static bool logmanager_init_nomutex(int argc, char* argv[])
static void logmanager_done_nomutex(void** ctx) >>
static void logmanager_done_nomutex(void)
2013-08-04 23:07:54 +03:00
25d26eb3b8
Corrected a typo in line feed handling.
2013-07-27 12:23:47 +03:00
7a6129861e
Added timestamp to log file headers and to the beginning of each line. Removed additional line feeds.
...
Example:
SkySQL MaxScale Sat Jul 27 12:13:10 2013
------------------------------------------
2013 07/27 12:13:10 Loaded module testroute: V1.0.0
2013 07/27 12:13:10 Initialise debug CLI router module V1.0.1.
2013 07/27 12:13:10 Loaded module debugcli: V1.0.1
2013-07-27 12:14:30 +03:00
b566c41067
Log manager sometimes failed to flush after skygw_log_write_flush because log client signaled filw writer thread too early. Fixed so that write is done first and file writer is registered after that. Except in cases where skygw_log_flush was called. Then only flush is triggered.
...
Added a few trivial cases to test.
2013-07-26 23:06:12 +03:00
3989615197
Code polishing.
2013-07-26 21:46:23 +03:00
ff8b432943
Added run-time path to dynamically loadable libraries; '-Wl,rpath,$(DEST)/lib' to makefile. When compiling, use
...
make DEST=<path to library directory>
2013-07-26 19:20:06 +03:00
2f189cb153
Log manager erroneously wrote string termination character after every log message.
...
Added a few trivial test cases.
2013-07-26 15:21:54 +03:00
52564314d4
Documented concurrency control between filewriter thread and log clients.
...
Changed log header text, replaced SkySQL GAteway with SkySQL MaxScale.
Fixed bug in log flushing. skygw_log_write_flush didn't cause call of fsync, which suspended file writing.
2013-07-25 16:21:13 +03:00
baed0e846f
Changed log_manager to use block-siuze buffers instead of small write buffers. Added new test cases and added iterations. Added possibility to test with dummy disk write which sleeps constantly for 5ms instead of performing disk write.
2013-07-23 08:34:43 +03:00
bce6f88efe
Add depend make target and resolve conflict in query_classifier.cc
2013-07-19 15:05:21 +02:00
53c6d6daa6
Updates for make install rules
2013-07-17 13:31:18 +02:00
3d3ba6f986
Division by zero :-)
2013-07-09 12:13:34 +03:00
bce2573c21
Fixed bug which tried to access list without mutex.
2013-07-02 18:04:00 +03:00
6abd9dbdaa
Added profile counters: writebuffer init, done, total and recycle counts.
2013-07-02 16:53:23 +03:00
d11741130d
Changed log manager API to support variable length formatted log strings. New API is as follows:
...
/** No change in these */
bool skygw_logmanager_init(void** buf, int argc, char* argv[]);
void skygw_logmanager_done(void** buf);
void skygw_logmanager_exit(void);
int skygw_log_flush(logfile_id_t id);
/** writebuf remains unused, but formatted string is now possible and in case
* of formatted string, arbitrary long argument list is supported too. Max
* length for a log string is defined to BUFSIZ, whose value depends on the
* system but typically is 4/8KB.
*/
int skygw_log_write(void* writebuf, logfile_id_t id, char* format, ...);
int skygw_log_write_flush(void* writebuf, logfile_id_t id, char* format, ...);
makefile.inc includes new CFLAG : SS_PROF, which is set if PROF=Y on make command line or in build_gateway.inc .
ss_debug.h includes corresponding ss_prof(exp) macro which equals to exp if SS_PROF is defined and to empty if in other case.
mlist_t now includes datadel function which is a callback and it is executed for mlnode_data on node exit.
2013-07-02 14:46:39 +03:00
1888b8a517
Prevented redefinition of bool, added function void skygw_logmanager_exit(void) to be called by atexit
2013-06-28 11:39:00 +03:00
1b764eba74
Little fixes
2013-06-27 23:33:20 +03:00
b26315cf24
Can't compile product version.
2013-06-27 16:54:54 +03:00
5c271e1925
Fixed clean-up processes in cases where initialization fails arbitrarily in the middle of startup. Added four descriptive states : UNINIT, INIT, RUN, DONE for flat stucts inside logmanager. Flat structs always have the state which tells what needs to be fred, if any.
2013-06-27 16:43:01 +03:00
9630ae588e
Fixed bugs and cleaned code
2013-06-27 12:18:25 +03:00
70b19a0481
Fixed printing issues.
2013-06-26 23:43:57 +03:00
2b8c62a7da
Added a few more testcases to increase IO and added debug printing for file handling.
2013-06-26 23:40:07 +03:00
b74423121f
Removed references to epoll code.
2013-06-26 23:26:21 +03:00
c8831f0a89
I didn't know these even existed in bazaar. Now they are removed.
2013-06-26 23:18:36 +03:00
ef1d198654
Changed log manager API so that pointer reference to logmanager is not used anymore. Every call initializes logmanager now except skygw_logmanager_done and skygw_log_flush.
...
skygw_logmanager_init is still useful because it allows for providing memory address for log manager where it can store a list of preallocated write buffers. TBD.
Logmanager access is now protected with spinlock familiar from epoll/core/spinlock.c . It is modified to avoid trashing; misses are counted and every tenth subsequent lock acquiring attempt triggers short random sleep.
2013-06-26 23:13:40 +03:00
2ea8e2a05a
Added licences and changed the use of zero-length arrays due to compiler problems.
2013-06-26 09:39:38 +03:00
b82ee51b7a
Tiny changes, more tests.
2013-06-25 22:13:48 +03:00
8178e4e239
New, yet primitive version of log writing functionality. Fixed some things in utils.
2013-06-25 21:14:03 +03:00