Commit Graph

284 Commits

Author SHA1 Message Date
05fbdb1b76 Log: skygw_log_flush replaced with mxs_log_flush.
skygw_log_flush replaced with mxs_log_flush and skygw_log_sync_all
with mxs_log_flush_sync.
2015-11-12 18:28:34 +02:00
c7a329e43e Log: skygw_logmanager_init renamed to mxs_log_init.
skygw_logmanager_init renamed to mxs_log_init and skygw_logmanager_done
renamed to mxs_log_finish. skygw_logmanager_exit removed alltogether as
all it did was to call skygw_logmanager_done. That appears to have been
a source for confusion as in many places a call to skygw_logmanager_done
was followed by a call to skygw_logmanager_exit. In addition, the function
skygw_log_done was removed from the header, since it lacked an
implementation.
2015-11-12 16:06:44 +02:00
acb0a523a7 Log: No more argv parsing for log manager.
Earlier, the global setting for the syslog decided whether syslog
was enabled when skygw_logmanager_init was called, but not whether
logging to syslog actually was made.

Now syslog logging is enabled by default and the global setting
decides whether or not syslog logging actually is made. That is,
this opens up the possiblity for making it possible to turn on
and off sysloging at runtime.

Further, although the API led you to believe otherwise, it was
hardwired that LOGFILE_ERROR and LOGFILE_MESSAGE messages were
written to syslog.

The changed removed the need for passing an argv array explicitly.
2015-11-11 13:53:14 +02:00
24bed47794 Syslog ident must be provided explicitly.
The syslog ident must be provided explicitly when calling
skygw_logmanager_init (and not provided via the argv array).
It can be NULL, in which case it automatically will be the program
name.

The openlog() call is now always made, irrespective of what the
value of the global syslog flag is. That way it will be possible
to turn syslog logging on or off after the fact.
2015-11-11 13:48:57 +02:00
55dbaa49c0 Logging target must be explicitly defined.
Whether the log-file should be written to the filesystem or to
shared memory must now be explicitly defined when calling
skygw_logmanager_init() (instead of passing that via the argc/argv
construct).

Also, the meaning of '-l' when invoking maxscale has been changed.

Earlier -l [file|shm] specified whether the trace and debug logs
should be written to shared memory (while the error and message
logs always were written to the filesystem) and the _default_
was to write them to shared memory.

Now, with only one file, '-l' has still the same meaning, but it
decides whether the one and only logfile should be written to shared
memory, or the filesystem and the _default_ is to write it to the
filesystem.
2015-11-11 13:47:34 +02:00
450078fa92 Interface of skygw_logmanager_init(int argc, char* argv[]) changed.
The previous interface of skygw_logmanager_init was conceptually
broken. With -o you could specify that logging should be done to
stdout. However, even if you did that, the log manager still checked
that the logging directory could be accessed. Unless it had been
specified using -j <path> the default was /var/log/maxscale.

That is, unless the program calling skygw_logmanager_init was invoked
by a user that had write access to /var/log/maxscale, there would be
a complaint even if nothing was ever written to that directory.
In practice this meant that even if -o was used you had to provide
a -j with a path that surely is writeable (e.g. "/tmp").

This has now been changed so that you explicitly must provide the
log directory and the flags -j and -o are removed.

  bool skygw_logmanager_init(const char* logdir, int argc, char* argv[]);

If /logdir/ is provided then logged messages are written to a log file
in that directory. If /logdir/ is NULL then messages are logged to stdout
and no checks for access to any directory is not made.
2015-11-06 14:20:05 +02:00
834a88aeda Log variables moved to log_manager.h
The log manager variables lm_enabled_log_files_bitmask, log_ses_count
and tls_log_info that earlier were declared separately in every
c-file are now declared in the log_manager.h header.
2015-11-04 14:26:53 +02:00
846816a851 Changed from POSIX regular expressions to PCRE2 for the regexfilter. 2015-10-27 22:10:49 +02:00
447c3aa6c1 More code cleaning. 2015-09-29 12:03:21 +03:00
abab715a21 Simplified the code in parse_time. 2015-09-29 12:03:21 +03:00
f021d42820 Cleaned up the timerange string processing in dbfwfilter. 2015-09-29 12:03:21 +03:00
160bbb70ee MXS-251: strerror
Replaces all calls to strerror with calls to strerror_r. The former
is non-thread safe while the latter is.
2015-09-05 15:52:13 +03:00
a74ed87d07 Removed redundant linking of the utils library. 2015-08-10 10:40:00 +03:00
84db14d3da Fixed possible division by zero error. 2015-07-24 17:19:57 +03:00
78eab19c62 Fixed compiler warnings. 2015-07-14 17:13:09 +03:00
af6e010ba1 Added missing namedserverfilter documentation. 2015-07-10 13:51:32 +03:00
3d3b397a67 Merge branch 'develop' of https://github.com/srirampatil/MaxScale into srirampatil-develop
Conflicts:
	server/modules/filter/qlafilter.c
2015-06-11 18:41:56 +03:00
4cbcc4ecb6 Removed old unused cmake variables, updated documentation and fixed testall suite. 2015-05-26 15:12:29 +03:00
5f076b81d4 Merge branch 'install_dir_change' into develop
Conflicts:
	CMakeLists.txt
	Documentation/Tutorials/Administration-Tutorial.md
	log_manager/CMakeLists.txt
	server/core/CMakeLists.txt
	server/core/gateway.c
	server/core/maxkeys.c
	server/core/maxpasswd.c
	server/modules/filter/test/CMakeLists.txt
	server/modules/routing/CMakeLists.txt
2015-05-26 13:34:39 +03:00
229cdb73e7 Fixed concurrency issues in filters. 2015-05-21 15:30:52 +03:00
4eddec7989 Fixed MXS - 165: Concurrency issue while incrementing sessions in
qlafilter
2015-05-20 17:47:58 +05:30
14b2c149f5 Removed resource leaks in regexfilter. 2015-05-10 06:34:39 +03:00
3bd03fbe09 Merge branch 'logmanager_stdout' into develop 2015-05-04 11:03:24 +03:00
b53decb72b Fix to MXS-75: https://mariadb.atlassian.net/browse/MXS-75
COUNT(*) is no longer denied by wildcard rules.
2015-05-03 09:36:00 +03:00
d545150ceb Fix to MXS-70: https://mariadb.atlassian.net/browse/MXS-70
Added assert information to error log.
2015-05-02 05:51:25 +03:00
4cba9890fd MXS-98: https://mariadb.atlassian.net/browse/MXS-98
Added optional logging of regex filter matching to user defined file and trace log.
2015-05-01 18:54:19 +03:00
360db8b235 Changed all atoi calls to config_truth_value when they were used to generate boolean values. 2015-04-30 10:58:35 +03:00
6e4aa9862d Fixed a segfaul caused by a null pointer in dbfwfilter rule parsing. 2015-04-30 04:52:35 +03:00
e3620eddbb Merge branch 'develop' into logmanager_stdout 2015-04-30 04:28:40 +03:00
00abb38689 Fixed rule parsing 2015-04-29 19:19:36 +03:00
c190433c7d Fixed dbfwfilter rules.
Fixed at_times not working if combined with on_queries.
2015-04-29 14:29:43 +03:00
8bff81e0a9 Fixed rule parsing failing if at_times is used with on_queries. 2015-04-29 11:39:17 +03:00
9ce225c2cb Added log manager initialization flag that prints all logs to stdout. 2015-04-29 11:20:40 +03:00
9ef66a6028 The filter harness no longer builds the MaxScale core twice. 2015-04-28 11:23:40 +03:00
9e0a2bfc12 Changed relevant files to use get_cachedir() instead of using the now deprecated MAXSCALE_HOME. 2015-04-27 21:55:57 +03:00
bbcecc0db5 Changed all MaxScale.cnf code references to maxscale.cnf 2015-04-27 13:44:36 +03:00
17a7b2addb Updated more variables. 2015-04-26 20:08:27 +03:00
df9bc65430 Added variables that are used when installing instead of relative paths. 2015-04-25 18:35:47 +03:00
1188da1210 Added more logging to tee filter. 2015-04-16 23:11:35 +03:00
1b3af7d61f Fixes to Coverity defects. 2015-04-16 19:41:49 +03:00
051d891680 Added utility functions to skygw_utils and cleaned up tee filter. 2015-04-15 12:42:28 +03:00
9deb627360 Changed the names of the logs for the dbfwfilter ruleparser. 2015-04-04 05:32:45 +03:00
2471ebf55f Small update to rule parser. 2015-04-03 10:53:05 +03:00
89ca0f420a Added a rule parsing tool for the dbfwfilter. The tool can be build with the -DBUILD_TOOLS=Y flag for CMake. 2015-04-03 10:37:21 +03:00
e13ab6689d Fixed coverity defects. 2015-04-03 07:56:45 +03:00
a65c790c3b Fixed dbfwfilter tests. 2015-04-03 06:22:30 +03:00
fa7e0ea7c0 Added error message for multi-statements to dbfwfilter. 2015-04-02 16:47:43 +03:00
795a683c55 Added option for controlling case sensitivity of dbfwfilter regex. 2015-04-02 16:31:34 +03:00
10f97572de Fixed double quotes not woring with regex rules. 2015-04-02 16:20:36 +03:00
bd9fea4b3d Added support for comment lines in rules. 2015-04-02 14:53:49 +03:00