summaryrefslogtreecommitdiff
path: root/main/logger.c
AgeCommit message (Collapse)Author
2012-04-30Merged revisions 364635 via svnmerge from Mark Murawki
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r364635 | markm | 2012-04-30 11:51:12 -0400 (Mon, 30 Apr 2012) | 10 lines Sanatize result from bfd_find_nearest_line (BETTER_BACKTRACES) bfd_find_nearest_line can possibly set file to null resulting in a crash when strrchr(file) runs (closes issue ASTERISK-19815) Reported by Mark Murawski Tested by Mark Murawski ........ ........ Merged revisions 364650 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-30Fix logger deadlock on Asterisk shutdown.Richard Mudgett
The logger_thread() had an exit path that failed to release the logmsgs list lock. * Make logger_thread() exit path unlock the logmsgs list lock. * Made ast_log() not queue any messages to the logmsgs list if the close_logger_thread flag is set. (issue ASTERISK-19463) Reported by: Matt Jordan ........ Merged revisions 360933 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360934 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29Introducing the log message unique call identifiers featureJonathan Rose
Log messages will now display a call number that they are tied to (ordered for calls based on when they started). This feature is made to be minimally invasive without requiring changes to many of the existing log messages. These IDs won't show up for verbose messages on CLI (but they will in log files) This is currently in phase II of production, see more about this feature on the wiki -- https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging Review: https://reviewboard.asterisk.org/r/1823/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29undoing 360785 due to merging mistakeJonathan Rose
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29Introducing the log message unique call identifiers featureJonathan Rose
Log messages will now display a call number that they are tied to (ordered for calls based on when they started). This feature is made to be minimally invasive without requiring changes to many of the existing log messages. These IDs won't show up for verbose messages on CLI (but they will in log files) This is currently in phase II of production, see more about this feature on the wiki -- https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging Review: https://reviewboard.asterisk.org/r/1823/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22Kill off red blobs in most of main/*Kinsey Moore
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14Fix bogus reads/writes of console log levels in asterisk.c Russell Bryant
This patch updates the NUMLOGLEVELS define in logger.h to 32, to match the fact that logger.c implements 32 log levels (because of the custom log level stuff). asterisk.c uses this define to size an array of levels per remote console. This array is modified in ast_console_toggle_loglevel(), which is called by the "logger set level" CLI command. While the documentation for the CLI command doesn't make it terribly obvious, you can use this CLI command to toggle a custom log level on a remote console, as well. However, doing so led to an invalid array index in asterisk.c. This array is read from any time a log message is written to a console. So, all custom log level messages resulted in a bogus read if a remote console was connected. ........ Merged revisions 359259 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 359260 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14Re-commit the verbose branch.Tilghman Lesher
This change permits each verbose destination (consoles, logger) to have its own concept of what the verbosity level is. The big feature here is that the logger will now be able to capture a particular verbosity level without condemning each console to need to suffer that level of verbosity. Additionally, a stray 'core set verbose' will no longer change what will go to the log. Review: https://reviewboard.asterisk.org/r/1599/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-12Backed out core changes from r346391Matthew Jordan
During testing, it was discovered that there were a number of side effects introduced by r346391 and subsequent check-ins related to it (r346429, r346617, and r346655). This included the /main/stdtime/ test 'hanging', as well as the remote console option failing to receive the appropriate output after a period of time. I only backed out the changes to main/ and utils/, as this was adequate to reverse the behavior experienced. (issue ASTERISK-18974) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-29Allow each logging destination and console to have its own notion of the ↵Tilghman Lesher
verbosity level. Review: https://reviewboard.asterisk.org/r/1599 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-26Merged revisions 337974 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r337974 | rmudgett | 2011-09-26 14:35:23 -0500 (Mon, 26 Sep 2011) | 37 lines Merged revisions 337973 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r337973 | rmudgett | 2011-09-26 14:30:39 -0500 (Mon, 26 Sep 2011) | 30 lines Fix deadlock when using dummy channels. Dummy channels created by ast_dummy_channel_alloc() should be destoyed by ast_channel_unref(). Using ast_channel_release() needlessly grabs the channel container lock and can cause a deadlock as a result. * Analyzed use of ast_dummy_channel_alloc() and made use ast_channel_unref() when done with the dummy channel. (Primary reason for the reported deadlock.) * Made app_dial.c:dial_exec_full() not call ast_call() holding any channel locks. Chan_local could not perform deadlock avoidance correctly. (Potential deadlock exposed by this issue. Secondary reason for the reported deadlock since the held lock was part of the deadlock chain.) * Fixed some uses of ast_dummy_channel_alloc() not checking the returned channel pointer for failure. * Fixed some potential chan=NULL pointer usage in func_odbc.c. Protected by testing the bogus_chan value. * Fixed needlessly clearing a 1024 char auto array when setting the first char to zero is enough in manager.c:action_getvar(). (closes issue ASTERISK-18613) Reported by: Thomas Arimont Patches: jira_asterisk_18613_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: Thomas Arimont ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-08Merged revisions 334954 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r334954 | rmudgett | 2011-09-08 17:28:56 -0500 (Thu, 08 Sep 2011) | 17 lines Merged revisions 334953 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r334953 | rmudgett | 2011-09-08 17:27:40 -0500 (Thu, 08 Sep 2011) | 10 lines Fix crash with res_fax when MALLOC_DEBUG and "core stop gracefully" are used. Asterisk crashes if MALLOC_DEBUG is enabled when res_fax tries to unregister its logger level. * Make ast_logger_unregister_level() use ast_free() instead of free(). When MALLOC_DEBUG is enabled, ast_free() does not degenerate into a call to free(). Therefore, if you allocated memory with a form of ast_malloc you must free it with ast_free. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07log Asterisk Version number, Build etc into each log fileAlec L Davis
Allow tracking of previous versions through log file records to be tracked. Each time log file is created or opened, log Asterisk Version, Buildinfo. etc. alecdavis (license 585) Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/1409/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-12Merged revisions 331654 via svnmerge from Kinsey Moore
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r331654 | kmoore | 2011-08-12 11:21:37 -0500 (Fri, 12 Aug 2011) | 19 lines Merged revisions 331649 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r331649 | kmoore | 2011-08-12 11:20:25 -0500 (Fri, 12 Aug 2011) | 12 lines Logger does not warn of failure to open logging channels Currently, logger only prints an error message to stderr when it fails to open a logger channel where many users will not see it because the logger lock is held. The alternative provided by this patch is to log the error to all attached consoles in the hopes that it will be easier to see. Additionally, this patch prevents the failed logger channel from being added to the list where it would silently fail on each call to the Asterisk logger. (closes issue ASTERISK-16231) Review: https://reviewboard.asterisk.org/r/1338 ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-10Merged revisions 331462 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r331462 | rmudgett | 2011-08-10 15:41:35 -0500 (Wed, 10 Aug 2011) | 37 lines Merged revisions 331461 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r331461 | rmudgett | 2011-08-10 15:29:59 -0500 (Wed, 10 Aug 2011) | 30 lines Output of queue log not started until logger reloaded. ASTERISK-15863 caused a regression with queue logging. The output of the queue log is not started until the logger configuration is reloaded. * Queue log initialization is completely delayed until the first message is posted to the queue log system. Including the initial opening of the queue log file. * Fixed rotate_file() ROTATE strategy to give the file just rotated out to the configured exec function after rotate. Just like the other strategies. * Fixed logger reload to always post the queue reload entry instead of just if there is a queue log file. * Refactored some code to eliminate some redundancy and to reduce stack utilization. (closes issue ASTERISK-17036) JIRA SWP-2952 Reported by: Juan Carlos Valero Patches: jira_asterisk_17036_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: rmudgett (closes issue ASTERISK-18208) Reported by: Christian Pinedo Review: https://reviewboard.asterisk.org/r/1333/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-08Merged revisions 307092 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r307092 | qwell | 2011-02-08 15:24:01 -0600 (Tue, 08 Feb 2011) | 9 lines Fix issue with verbose messages not showing on remote console. This code was reworked recently, and since the logchannel list hadn't been created yet at this point, and it was a verbose message, it was being dropped on the floor. Now it'll continue on to where it should be handled. (closes issue #18580) Reported by: pabelanger ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04Replace ast_log(LOG_DEBUG, ...) with ast_debug()Paul Belanger
(closes issue #18556) Reported by: kkm Review: https://reviewboard.asterisk.org/r/1071/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-31Support an alternate configuration file for the 'logger reload' command.Tilghman Lesher
(closes issue #17668) Reported by: tilghman Patches: 20100718__logger_reload_altconf__2.diff.txt uploaded by tilghman (license 14) Review: (by lmadsen, russell within comments on issue tracker) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-18Merged revisions 298960 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r298960 | tilghman | 2010-12-17 17:52:04 -0600 (Fri, 17 Dec 2010) | 20 lines Merged revisions 298957 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r298957 | tilghman | 2010-12-17 17:30:55 -0600 (Fri, 17 Dec 2010) | 13 lines Merged revisions 298905 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r298905 | tilghman | 2010-12-17 15:40:56 -0600 (Fri, 17 Dec 2010) | 6 lines Let Asterisk find better backtrace information with libbfd. The menuselect option BETTER_BACKTRACES, if enabled, will use libbfd to search for better symbol information within both the Asterisk binary, as well as loaded modules, to assist when using inline backtraces to track down problems. Review: https://reviewboard.asterisk.org/r/1055/ ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-12Add support for several platforms to obtain the real thread ID.Jeff Peeler
Already had the pthread ID which is not the same. The most obvious enhancement is in the "core show threads" output. As stated in the utils header, if the platform isn't supported -1 is reported (instead of the process ID previously). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-21Merged revisions 287863 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r287863 | russell | 2010-09-21 08:41:41 -0500 (Tue, 21 Sep 2010) | 2 lines Fix a regression in verbose logger processing. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-20Merged revisions 287639 via svnmerge from Brett Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r287639 | bbryant | 2010-09-20 17:19:12 -0400 (Mon, 20 Sep 2010) | 8 lines Fixes an error with the logger that caused verbose messages to be spammed to the screen if syslog was configured in logger.conf (closes issue #17974) Reported by: lmadsen Review: https://reviewboard.asterisk.org/r/915/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-25Merged revisions 279390 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r279390 | tilghman | 2010-07-25 12:32:21 -0500 (Sun, 25 Jul 2010) | 8 lines Don't assume qlog is open. (closes issue #17704) Reported by: vrban Patches: issue17704.patch uploaded by pabelanger (license 224) Tested by: vrban ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@279391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20Separate queue_log arguments into separate fields, and allow the text file ↵Tilghman Lesher
to be used, even when realtime is used. (closes issue #17082) Reported by: coolmig Patches: 20100720__issue17082.diff.txt uploaded by tilghman (license 14) Tested by: coolmig git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-11Remove lines from the output related to the backtrace itself.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-10Ensure that 'logger show channels' works properly when wildcards are used in ↵Kevin P. Fleming
logger.conf. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-10Merged revisions 269635 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r269635 | tilghman | 2010-06-10 02:52:34 -0500 (Thu, 10 Jun 2010) | 9 lines Ensure restartable system calls can restart (BSD signal semantics). This eliminates the annoying <beep> on the console. (closes issue #17477) Reported by: jvandal Patches: 20100610__issue17477.diff.txt uploaded by tilghman (license 14) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-26Merged revisions 266142 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r266142 | tilghman | 2010-05-26 16:11:44 -0500 (Wed, 26 May 2010) | 14 lines Use sigaction for signals which should persist past the initial trigger, not signal. If you call signal() in a Solaris signal handler, instead of just resetting the signal handler, it causes the signal to refire, because the signal is not marked as handled prior to the signal handler being called. This effectively causes Solaris to immediately exceed the threadstack in recursive signal handlers and crash. (closes issue #17000) Reported by: rmcgilvr Patches: 20100526__issue17000.diff.txt uploaded by tilghman (license 14) Tested by: rmcgilvr ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-20Correct 'all logger levels' patch to work properly.Kevin P. Fleming
Nick Lewis pointed out that the patch as committed wouldn't actually include dynamic logger levels, which was missed by the other reviewers. Thanks! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19Add ability for logger channels to include *all* levels.Kevin P. Fleming
Now that Asterisk modules can dynamically create and destroy logger levels on demand, it's useful to be able to configure a logger channel (console, file, whatever) to be able to accept log messages from *all* levels, even levels created dynamically. This patch adds support for this, by allowing the '*' level name to be used in logger.conf. Review: https://reviewboard.asterisk.org/r/663/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-12CLI command logger set level auto complete.Leif Madsen
A simple patch to enable auto tab complete. (closes issue #17152) Reported by: pabelanger Patches: 0017152.patch uploaded by pabelanger (license 224) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-24Merged revisions 248582 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r248582 | tilghman | 2010-02-24 15:02:18 -0600 (Wed, 24 Feb 2010) | 7 lines Remove color code sequences from verbose messages that go to logfiles. (closes issue #16786) Reported by: dodo Patches: logger2.patch uploaded by dodo (license 989) Tested by: tilghman ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-02Initialize a variable that we check immediately upon startup.Tilghman Lesher
(closes issue #15973) Reported by: atis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-17Correct the return value check for ast_safe_system.Sean Bright
The logic here was reversed as ast_safe_system returns -1 on error and not on success. Fix suggested by reporter. (closes issue #15667) Reported by: loic git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@212574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26Merge the new Channel Event Logging (CEL) subsystem.Russell Bryant
CEL is the new system for logging channel events. This was inspired after facing many problems trying to represent what is possible to happen to a call in Asterisk using CDR records. For more information on CEL, see the built in HTML or PDF documentation generated from the files in doc/tex/. Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard work developing this code. Also, thanks to Matt Nicholson (mnicholson) and Sean Bright (seanbright) for their assistance in the final push to get this code ready for Asterisk trunk. Review: https://reviewboard.asterisk.org/r/239/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25Move syslog utility functions into a separate file so they can be re-used.Sean Bright
This has the pleasant side effect of cleaning up the header inclusion process in logger.c. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25Pass a logmsg to ast_log_vsyslog instead of separate arguments.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15More 'static' qualifiers on module global variables.Kevin P. Fleming
The 'pglobal' tool is quite handy indeed :-) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28Fix an incorrect call to ast_string_field_free_memory which caused a crash ↵Joshua Colp
in the logger. Since the message structure is allocated using ast_calloc_with_stringfields we do not need to free the memory used for the stringfields as it will get freed when the message structure is. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-15Add ability for modules to dynamically register logger levelsKevin P. Fleming
This patch adds the ability for modules to dynamically create logger levels for their own use; these are named levels just like the built-in levels, and can be directed to any destination that the logger can send any level to, by including their names in logger.conf. Review: https://reviewboard.asterisk.org/r/244/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-13Two fixes found while debugging with ast_backtrace():Tilghman Lesher
1) If MALLOC_DEBUG is used when concurrently using ast_backtrace, the free() used in that routine will trigger an error, because the memory was allocated internally to libc, where we could not intercept that call to wrap it. Therefore, it's not memory we knew about, and the free is reported as an error. 2) Now that channels are objects, the old hack of initializing a channel to all zeroes no longer works, since we may try to call something like ast_channel_lock() within a function on that reference. In that case, it's reported as an error, because the pointer isn't an object reference. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-08Merged revisions 193193 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r193193 | kpfleming | 2009-05-08 09:03:28 -0500 (Fri, 08 May 2009) | 7 lines Make absolute paths for logger channels work properly (Note: This is not a new feature, it was previously undocumented and broken.) The Asterisk logger has a feature to support absolute pathnames for logger channels, but the code implementing the feature was broken. This has been fixed, and the absolute path feature is now documented in the sample logger.conf. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02Remove rarely-used event_log/LOG_EVENT supportKevin P. Fleming
In discussions today at the Europe Asterisk Developer Meet-Up, we determined that the event_log was used in only 9 places in the entire tree, and really was not needed at all. The users have been converted to use LOG_NOTICE, or the messages have been removed since other messages were already in place that provided the same information. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02Fix an error in queue_log file rotation optimization codeKevin P. Fleming
This code was copy-and-pasted without properly changing references to event_rotate into queue_rotate, so under some conditions the log rotation would rotate queue_log even though it was not necessary. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24Convert the ast_channel data structure over to the astobj2 framework.Russell Bryant
There is a lot that could be said about this, but the patch is a big improvement for performance, stability, code maintainability, and ease of future code development. The channel list is no longer an unsorted linked list. The main container for channels is an astobj2 hash table. All of the code related to searching for channels or iterating active channels has been rewritten. Let n be the number of active channels. Iterating the channel list has gone from O(n^2) to O(n). Searching for a channel by name went from O(n) to O(1). Searching for a channel by extension is still O(n), but uses a new method for doing so, which is more efficient. The ast_channel object is now a reference counted object. The benefits here are plentiful. Some benefits directly related to issues in the previous code include: 1) When threads other than the channel thread owning a channel wanted access to a channel, it had to hold the lock on it to ensure that it didn't go away. This is no longer a requirement. Holding a reference is sufficient. 2) There are places that now require less dealing with channel locks. 3) There are places where channel locks are held for much shorter periods of time. 4) There are places where dealing with more than one channel at a time becomes _MUCH_ easier. ChanSpy is a great example of this. Writing code in the future that deals with multiple channels will be much easier. Some additional information regarding channel locking and reference count handling can be found in channel.h, where a new section has been added that discusses some of the rules associated with it. Mark Michelson also assisted with the development of this patch. He did the conversion of ChanSpy and introduced a new API, ast_autochan, which makes it much easier to deal with holding on to a channel pointer for an extended period of time and having it get automatically updated if the channel gets masqueraded. Mark was also a huge help in the code review process. Thanks to David Vossel for his assistance with this branch, as well. David did the conversion of the DAHDIScan application by making it become a wrapper for ChanSpy internally. The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch. Review: http://reviewboard.digium.com/r/203/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10revert addition of LOG_SECURITY log channel; after further discussion, a ↵Kevin P. Fleming
much better solution will be used git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09add a dedicated log channel for modules to be able report security-related ↵Kevin P. Fleming
events, so that they can be fed into external processes for analysis and possible mitigation efforts (inspired by this evening's Toronto Asterisk Users Group meeting and previous dicussions amongst various community members) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16Assist proper thread synchronization when stopping the logger thread.Mark Michelson
I was finding that on my dev box, occasionally attempting to "stop now" in trunk would cause Asterisk to hang. I traced this to the fact that the logger thread was waiting on a condition which had already been signalled. The logger thread also need to be sure to check the value of the close_logger_thread variable. The close_logger_thread variable is only checked when the list of logmessages is empty. This allows for the logger thread to print and free any pending messages before exiting. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09Added a comment to logger.c about where to put includesMatthew Nicholson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168054 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09Use ast_safe_system() in logger.c instead of system()Matthew Nicholson
(closes issue #14194) Reported by: pabelanger git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168014 65c4cc65-6c06-0410-ace0-fbb531ad65f3