summaryrefslogtreecommitdiff
path: root/main/logger.c
AgeCommit message (Collapse)Author
2016-06-01logging,cdr,cel: Fix stringfield memory leak.Richard Mudgett
The stringfields refactor to allow adding stringfields to the end of a structure (f6f4cf459f43f072604927209b39646f84aaa2e2) exposed some incomplete cleanup code by some stringfield users. The most noticeable leaker is the logging system where there is a leak for every log message generated. ASTERISK-26078 #close Reported by: Etienne Lessard Patches: jira_asterisk_26078_v13.patch (license #5621) patch uploaded by Richard Mudgett Change-Id: If6a08b31336b492c3de6f9dfd07c447f8d5a8782
2016-05-19Merge "logger: Support JSON logging with Verbose messages"Joshua Colp
2016-05-14logger: Support JSON logging with Verbose messagesMatt Jordan
When 2d7a4a3357 was merged, it missed the fact that Verbose log messages are formatted and handled by 'verbosers'. Verbosers are registered functions that handle verbose messages only; they exist as a separate class of callbacks. This was done to handle the 'magic' that must be inserted into Verbose messages sent to remote consoles, so that the consoles can format the messages correctly, i.e., the leading tabs/characters. In reality, verbosers are a weird appendage: they're a separate class of formatters/message handlers outside of what handles all other log messages in Asterisk. After some code inspection, it became clear that simply passing a Verbose message along with its 'sublevel' importance through the normal logging mechanisms removes the need for verbosers altogether. This patch removes the verbosers, and makes the default log formatter aware that, if the log channel is a console log, it should simply insert the 'verbose magic' into the log messages itself. This allows the console handlers to interpret and format the verbose message themselves. This simplifies the code quite a lot, and should improve the performance of printing verbose messages by a reasonable factor: (1) It removes a number of memory allocations that were done on each verobse message (2) It removes the need to strip the verbose magic out of the verbose log messages before passing them to non-console log channels (3) It now performs fewer iterations over lists when handling verbose messages Since verbose messages are now handled like other log messages (for the most part), the JSON formatting of the messages works as well. ASTERISK-25425 Change-Id: I21bf23f0a1e489b5102f8a035fe8871552ce4f96
2016-05-12logger: Add PID to syslog messages.Alexei Gradinari
During refactoring of this support the addition of the PID to messages was removed. This change adds it back in. ASTERISK-25538 #close Change-Id: Ie2d43b0652e59b7ac319a7dba94501540d70ba36
2016-03-24core/logging: Fix broken syslog levels on older glibc.Walter Doekes
The fix to ASTERISK-25407 introduced the usage of LOG_MAKEPRI. However this macro is broken in older glibc (< 2.17); it would left-shift the facility a second time, causing the resultant priority to become invalid. The syslog manpage mentions nothing about LOG_MAKEPRI and suggests this: The priority argument is formed by ORing the facility and the level values [...]. ASTERISK-25510 #close Reported by: Michael Newton Change-Id: Ia89debe7fac5ad090c7ef595c0707f31bb1e3d03
2016-01-22logger.c: Fix buffer overrun found by address sanitizer.Richard Mudgett
The null terminator of the tail struct member was not being allocated when no logger.conf config file is installed. ASTERISK-25714 #close Reported by: Badalian Vyacheslav Change-Id: I45770fdd08af39506a3bc33ba279c4f16e047a30
2016-01-19Refactor init_logger_chain locking.Corey Farrell
This removes logchannels locking from init_logger_chain, puts the responsibility on the caller. Adds locking around the one call that was missing it. ASTERISK-24833 Change-Id: I6cc42117338bf9575650a67bcb78ab1a33d7bad8
2015-11-10Remove ABI compatibility stub functions.Corey Farrell
ABI compatibility stubs existed for ast_app_separate_args and ast_verbose, this is not needed in master. Change-Id: I07b4d2c16079da3c2c6efa55df4a74368e0bd453
2015-09-29main/logger: Add log formatters and JSON structured logsMatt Jordan
When Asterisk is part of a larger distributed system, log files are often gathered using tools (such as logstash) that prefer to consume information and have it rendered using other tools (such as Kibana) that prefer a structured format, e.g., JSON. This patch adds support for JSON formatted logs by adding support for an optional log format specifier in Asterisk's logging subsystem. By adding a format specifier of '[json]': full => [json]debug,verbose,notice,warning,error Log messages will be output to the 'full' channel in the following format: { "hostname": Hostname or name specified in asterisk.conf "timestamp": Date/Time "identifiers": { "lwp": Thread ID, "callid": Call Identifier } "logmsg": { "location": { "filename": Name of the file that generated the log statement "function": Function that generated the log statement "line": Line number that called the logging function } "level": Log level, e.g., DEBUG, VERBOSE, etc. "message": Actual text of the log message } } ASTERISK-25425 #close Change-Id: I8649bfedf3fb7bf3138008cc11565553209cc238
2015-09-24logger: Prevent duplicate dynamic channels from being added.Mark Michelson
There was a problem observed where the "logger add channel" CLI command would allow for a channel with the same name to be added multiple times. This would result in each message being written out to the same file multiple times. The problem was due to the difference in how logger channel filenames are stored versus the format they are allowed to be presented when they are added. For instance, if adding the logger channel "foo" through the CLI, the result would be a logger channel with the file name /var/log/asterisk/foo being stored. So when trying to add another "foo" channel, "foo" would not match "/var/log/asterisk/foo" so we'd happily add the duplicate channel. The fix presented here is to introduce two new methods in the logger code: * make_filename(): given a logger channel name, this creates the filename for that logger channel. * find_logchannel(): given a logger channel name, this calls make_filename() and then traverses the list of logchannels in order to find a match. This change has made use of make_filename() and find_logchannel() throughout to more consistently behave. ASTERISK-25305 #close Reported by Mark Michelson Change-Id: I892d52954d6007d8bc453c3cbdd9235dec9c4a36
2015-09-21core/logging: Fix logging to more than one syslog channelElazar Broad
Currently, Asterisk will log to the last configured syslog channel in logger.conf. This is due to the fact that the final call to openlog() supersedes all of the previous calls. This commit removes the call to openlog() and passes the facility to ast_log_vsyslog(), along with utilizing the LOG_MAKEPRI macro to ensure that the message is routed to the correct facility and with the correct priority. ASTERISK-25407 #close Reported by: Elazar Broad Tested by: Elazar Broad Change-Id: Ie2a2416bc00cce1b04e99ef40917c2011953ddd2
2015-08-07ARI: Retrieve existing log channelsScott Emidy
An http request can be sent to get the existing Asterisk logs. The command "curl -v -u user:pass -X GET 'http://localhost:8088 /ari/asterisk/logging'" can be run in the terminal to access the newly implemented functionality. * Retrieve all existing log channels ASTERISK-25252 Change-Id: I7bb08b93e3b938c991f3f56cc5d188654768a808
2015-08-07ARI: Creating log channelsScott Emidy
An http request can be sent to create a log channel in Asterisk. The command "curl -v -u user:pass -X POST 'http://localhost:088/ari/asterisk/logging/mylog? configuration=notice,warning'" can be run in the terminal to access the newly implemented functionality for ARI. * Ability to create log channels using ARI ASTERISK-25252 Change-Id: I9a20e5c75716dfbb6b62fd3474faf55be20bd782
2015-08-06ARI: Deleting log channelsScott Emidy
An http request can be sent to delete a log channel in Asterisk. The command "curl -v -u user:pass -X DELETE 'http://localhost:8088 /ari/asterisk/logging/mylog'" can be run in the terminal to access the newly implemented functionally for ARI. * Able to delete log channels using ARI ASTERISK-25252 Change-Id: Id6eeb54ebcc511595f0418d586ff55914bc3aae6
2015-07-31ARI: Rotate log channels.Benjamin Ford
An http request can be sent to rotate a specified log channel. If the channel does not exist, an error response will be returned. The command "curl -v -u user:pass -X PUT 'http://localhost:8088 /ari/asterisk/logging/logChannelName/rotate'" can be run in the terminal to access this new functionality. * Added the ability to rotate log files through ARI ASTERISK-25252 Change-Id: Iaefa21cbbc1b29effb33004ee3d89c977e76ab01
2015-05-20Logger: Reset defaults before processing config.Corey Farrell
Reset options to default values before reloading config. This ensures that if a setting is removed or commented out of the configuration file it is unset on reload. ASTERISK-25112 #close Reported by: Corey Farrell Change-Id: Id24bb1fb0885c2c14cf8bd6f69a0c2ee7cd6c5bd
2015-04-13git migration: Refactor the ASTERISK_FILE_VERSION macroMatt Jordan
Git does not support the ability to replace a token with a version string during check-in. While it does have support for replacing a token on clone, this is somewhat sub-optimal: the token is replaced with the object hash, which is not particularly easy for human consumption. What's more, in practice, the source file version was often not terribly useful. Generally, when triaging bugs, the overall version of Asterisk is far more useful than an individual SVN version of a file. As a result, this patch removes Asterisk's support for showing source file versions. Specifically, it does the following: * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and remove passing the version in with the macro. Other facilities than 'core show file version' make use of the file names, such as setting a debug level only on a specific file. As such, the act of registering source files with the Asterisk core still has use. The macro rename now reflects the new macro purpose. * main/asterisk: - Refactor the file_version structure to reflect that it no longer tracks a version field. - Remove the "core show file version" CLI command. Without the file version, it is no longer useful. - Remove the ast_file_version_find function. The file version is no longer tracked. - Rename ast_register_file_version/ast_unregister_file_version to ast_register_file/ast_unregister_file, respectively. * main/manager: Remove value from the Version key of the ModuleCheck Action. The actual key itself has not been removed, as doing so would absolutely constitute a backwards incompatible change. However, since the file version is no longer tracked, there is no need to attempt to include it in the Version key. * UPGRADE: Add notes for: - Modification to the ModuleCheck AMI Action - Removal of the "core show file version" CLI command Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-03-27Improved and portable ast_log recursion avoidanceCorey Farrell
This introduces a new logger routine ast_log_safe. This routine should be used for all error messages in code that can be run as a result of ast_log. ast_log_safe does nothing if run recursively. All error logging in astobj2.c, strings.c and utils.h have been switched to ast_log_safe. This required adding support for raw threadstorage. This provides direct access to the void* pointer in threadstorage. In ast_log_safe, NULL is used to signify that this thread is not already running ast_log_safe, (void*)1 when it is already running. This was done since it's critical that ast_log_safe do nothing that could log during recursion checking. ASTERISK-24155 #close Reported by: Timo Teräs Review: https://reviewboard.asterisk.org/r/4502/ ........ Merged revisions 433522 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 433523 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-19logger: Apply default console logging when configuration cannot be loaded.Corey Farrell
When logger.conf is missing or invalid enable console logging and display an error message. ASTERISK-24817 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4497/ ........ Merged revisions 433122 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 433126 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-13Logger: Fix MALLOC_DEBUG build error.Corey Farrell
Revision 432834 introduced a build error when MALLOC_DEBUG is used. Switch callid threadstorage to simple AST_THREADSTORAGE since we no longer need custom cleanup. Reported by: Corey Farrell git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-13Logger: Convert 'struct ast_callid' to unsigned int.Corey Farrell
Switch logger callid's from AO2 objects to simple integers. This helps in two ways. Copying integers is faster than referencing AO2 objects, so this will result in a small reduction in logger overhead. This also erases the possibility of an infinate loop caused by an invalid callid in threadstorage. ASTERISK-24833 #comment Committed callid conversion to trunk. Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4466/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22queue_log: Post QUEUESTART entry when Asterisk fully boots.Richard Mudgett
The QUEUESTART log entry has historically acted like a fully booted event for the queue_log file. When the QUEUESTART entry was posted to the log was broken by the change made by ASTERISK-15863. * Made post the QUEUESTART queue_log entry when Asterisk fully boots. This restores the intent of that log entry and happens after realtime has had a chance to load. AST-1444 #close Reported by: Denis Martinez Review: https://reviewboard.asterisk.org/r/4282/ ........ Merged revisions 430009 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 430010 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-13logger: Don't store verbose-magic in the log files.Walter Doekes
In r399267, the verbose2magic stuff was edited. This time it results in magic characters in the log files for multiline messages. In trunk (and 13) this was fixed by the "stripping" of those characters from multiline messages (in r414798). This fix is altered to actually strip the characters and not replace them with blanks. Review: https://reviewboard.asterisk.org/r/3901/ Review: https://reviewboard.asterisk.org/r/3902/ ........ Merged revisions 420897 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 420898 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 420899 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-18astobj2: assert on invalid ref and backtrace cleanupScott Griepentrog
If a reference count goes negative, instead of just logging that fact, be more helpful with a backtrace and an assert that will DO_CRASH. This patch also removes the duplicate ao2_bt() function and cleans up extraneous usage of the ast_log_backtrace() call. Review: https://reviewboard.asterisk.org/r/3765/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20Logger: Add manager command 'LoggerRotate' to rotate loggerJonathan Rose
Part of a series of AMI command equivalents to existing CLI commands Review: https://reviewboard.asterisk.org/r/3651/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-19Fix build warnings with TEST_FRAMEWORK enabledKinsey Moore
........ Merged revisions 416732 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416733 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416734 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-28Logger/CLI/etc.: Fix some aesthetic issues; reduce chatty verbose messagesMatthew Jordan
This patch addresses some aesthetic issues in Asterisk. These are all just minor tweaks to improve the look of the CLI when used in a variety of settings. Specifically: * A number of chatty verbose messages were removed or demoted to DEBUG messages. Verbose messages with a verbosity level of 5 or higher were - if kept as verbose messages - demoted to level 4. Several messages that were emitted at verbose level 3 were demoted to 4, as announcement of dialplan applications being executed occur at level 3 (and so the effects of those applications should generally be less). * Some verbose messages that only appear when their respective 'debug' options are enabled were bumped up to always be displayed. * Prefix/timestamping of verbose messages were moved to the verboser handlers. This was done to prevent duplication of prefixes when the timestamp option (-T) is used with the CLI. * Verbose magic is removed from messages before being emitted to non-verboser handlers. This prevents the magic in multi-line verbose messages (such as SIP debug traces or the output of DumpChan) from being written to files. * _Slightly_ better support for the "light background" option (-W) was added. This includes using ast_term_quit in the output of XML documentation help, as well as changing the "Asterisk Ready" prompt to bright green on the default background (which stands a better chance of being displayed properly than bright white). Review: https://reviewboard.asterisk.org/r/3547/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09Allow Asterisk to compile under GCC 4.10Kinsey Moore
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-13Logger: Add dynamic logger channelsKinsey Moore
This adds the ability to dynamically add and remove logger channels from Asterisk via the CLI. (closes issue AST-1150) Review: https://reviewboard.asterisk.org/r/3185/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-05Logger: Fix handling of absolute pathsKinsey Moore
This fixes path handling for log files so that an extra / is not appended to the file path when the path is absolute (begins with /). This would previously result in different but functionally equivalent paths in the output of 'logger show channels'. ........ Merged revisions 407455 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407456 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 407458 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407459 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-14verbosity: Fix performance of console verbose messages.Richard Mudgett
The per console verbose level feature as previously implemented caused a large performance penalty. The fix required some minor incompatibilities if the new rasterisk is used to connect to an earlier version. If the new rasterisk connects to an older Asterisk version then the root console verbose level is always affected by the "core set verbose" command of the remote console even though it may appear to only affect the current console. If an older version of rasterisk connects to the new version then the "core set verbose" command will have no effect. * Fixed the verbose performance by not generating a verbose message if nothing is going to use it and then filtered any generated verbose messages before actually sending them to the remote consoles. * Split the "core set debug" and "core set verbose" CLI commands to remove the per module verbose support that cannot work with the per console verbose level. * Added a silent option to the "core set verbose" command. * Fixed "core set debug off" tab completion. * Made "core show settings" list the current console verbosity in addition to the root console verbosity. * Changed the default verbose level of the 'verbose' setting in the logger.conf [logfiles] section. The default is now to once again follow the current root console level. As a result, using the AMI Command action with "core set verbose" could again set the root console verbose level and affect the verbose level logged. (closes issue AST-1252) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/3114/ ........ Merged revisions 405431 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 405432 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-10Logging callid: Fix some sizeof() references per coding guidelines.Richard Mudgett
........ Merged revisions 405281 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 405282 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-24Logging: Logging types ignored after specifying a verbose levelKevin Harwell
If one specified a verbose level within a logging facility in logger.conf then any component after it was ignored. Fixed so all values are correctly read. (closes issue ASTERISK-22456) Reported by: Kevin Harwell ........ Merged revisions 401833 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 401835 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-20Fix memory leak in logger.Kevin Harwell
Fixed a memory leak discovered in the logger where a temporary string buffer was not being freed. (closes issue ASTERISK-22540) Reported by: John Hardin ........ Merged revisions 399513 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399514 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-17Remote console: more output discrepanciesKevin Harwell
The remote console continued to have issues with its output. In this case CLI command output would either not show up (if verbose level = 0) or would contain verbose prefixes (if verbose level > 0) once log messages were sent to the remote console. The fix now now adds verbose prefix data to all new lines contained in a verbose log string. (closes issue ASTERISK-22450) Reported by: David Brillert (closes issue AST-1193) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/2825/ ........ Merged revisions 399267 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399268 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29Verbose logging discrepanciesKevin Harwell
Refactored cases where a combination of ast_verbose/options_verbose were present. Also in general tried to eliminate, in as many places as possible, where the options_verbose global variable was being used. Refactored the way local and remote consoles handle verbose message logging in an attempt to solve the various discrepancies that sometimes would show between the two. (closes issue AST-1193) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/2798/ ........ Merged revisions 397948 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 397958 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23Fix memory corruption when trying to get "core show locks".Richard Mudgett
Review https://reviewboard.asterisk.org/r/2580/ tried to fix the mismatch in memory pools but had a math error determining the buffer size and didn't address other similar memory pool mismatches. * Effectively reverted the previous patch to go in the same direction as trunk for the returned memory pool of ast_bt_get_symbols(). * Fixed memory leak in ast_bt_get_symbols() when BETTER_BACKTRACES is defined. * Fixed some formatting in ast_bt_get_symbols(). * Fixed sig_pri.c freeing memory allocated by libpri when MALLOC_DEBUG is enabled. * Fixed __dump_backtrace() freeing memory from ast_bt_get_symbols() when MALLOC_DEBUG is enabled. * Moved __dump_backtrace() because of compile issues with the utils directory. (closes issue ASTERISK-22221) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2778/ ........ Merged revisions 397525 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397528 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-08Add backtrace generation to MALLOC_DEBUG memory corruption reportsMatthew Jordan
This patch allows astmm to access the backtrace generation code in Asterisk. When memory is allocated, a backtrace is created and stored with the memory region that tracks the allocation. If a memory corruption is detected, the backtrace is printed to the astmm log. The backtrace will make use of the BETTER_BACKTRACES build option if available. As a result, this patch moves the backtrace generation code into its own file and uses the non-wrapped versions of the C library memory allocation routines. This allows the memory allocation code to safely use the backtrace generation routines without infinitely recursing. Review: https://reviewboard.asterisk.org/r/2567 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24Print all logger messages on shutdownMatthew Jordan
When Asterisk shuts down and shuts down the loggin gsubsystem, any messages currently in flight will not get logged. This patch prevents the loop writing messages from breaking out prematurely, such that all of the messages are logged. (closes issue ASTERISK-21716) Reported by: Corey Farrell patches: logger-process-all-messages.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 389676 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 389677 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13Fix Missing CALL-ID When Logging Through SyslogMichael L. Young
The CALL-ID (ie [C-00000074]) is missing when logging to syslog. This was just an oversight when this feature was added. * Add CALL-IDs when using syslog (closes issue ASTERISK-21430) Reported by: Nikola Ciprich Tested by: Nikola Ciprich, Michael L. Young Patches: asterisk-21430-syslog-callid_trunk.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2526/ ........ Merged revisions 388605 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-07Ensure that logmsgs are freed properlyKinsey Moore
Messages sent while the logger thread is shutting down will now have their associated callid freed properly. ........ Merged revisions 382574 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15Stopped spamming of debug messages during attended transfer.Kevin Harwell
While autoservice is running and servicing a channel the callid is being stored and removed in the thread's local storage for each iteration of the thread loop. If debug was set to a sufficient level the log file would be spammed with callid thread local storage debug messages. Added a new function that checks to see if the callid to be stored is different than what is already contained (if anything). If it is different then store/replace and log, otherwise just leave as is. Also made it so all logging of debug messages pertaining to the callid thread storage outputs only when TEST_FRAMEWORK is defined. (issue ASTERISK-21014) (closes issue ASTERISK-21014) Report by: Rusty Newton Review: https://reviewboard.asterisk.org/r/2324/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14Revamp of terminal color codesKinsey Moore
The core module related to coloring terminal output was old and needed some love. The main thing here was an attempt to get rid of the obscene number of stack-local buffers that were allocated for no other reason than to colorize some output. Instead, this uses a simple trick to allocate several buffers within threadlocal storage, then automatically rotates between them, so that you can make multiple calls to the colorization routine within one function and not need to allocate multiple buffers. Review: https://reviewboard.asterisk.org/r/2241/ Patches: bug.patch uploaded by Tilghman Lesher git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-28Add queue_log_realtime_use_gmt option to logger.confRussell Bryant
Add an option that lets you specify that the timestamps going into the realtime queue log should be in GMT instead of local time. Review: https://reviewboard.asterisk.org/r/2287/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-16Reduce call-id logging resource usage.Richard Mudgett
Since there is no need for the call-id logging ao2 object to have a lock, don't create it with one. ........ Merged revisions 379232 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-09Fix logger.c function definition.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11Cleanup logger on exit.Richard Mudgett
* Cleanup CLI commands, destroy verbosers and logchannels lists on exit. (issue ASTERISK-20649) Reported by: Corey Farrell Patches: logger-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell Modified ........ Merged revisions 377771 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 377772 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 377773 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-23Re-initialize logmsgs mutex upon logger initialization to prevent lock errorsMatthew Jordan
Similar to the patch that moved the fork earlier in the startup sequence to prevent mutex errors in the recursive mutex surrounding the read/write thread registration lock, this patch re-initializes the logmsgs mutex. Part of the start up sequence before forking the process into the background includes reading asterisk.conf; this has to occur prior to the call to daemon in order to read startup parameters. When reading in a conf file, log statements can be generated. Since this can't be avoided, the mutex instead is re-initialized to ensure a reset of any thread tracking information. This patch also includes some additional debugging to catch errors when locking or unlocking the recursive mutex that surrounds locks when the DEBUG_THREADS build option is enabled. DO_CRASH or THREAD_CRASH will cause an abort() if a mutex error is detected. (issue ASTERISK-19463) Reported by: mjordan Tesetd by: mjordan ........ Merged revisions 376586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376587 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376588 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-18Doxygen Updates - Title updateAndrew Latham
Update and extend the configuration_file group and enable linking. Commit other cleanups from multi-version Doxygen testing. Update title that was left behind many years ago. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-18Make the casing of CALL_ID in debug messages consistent to satisfy my OCD.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373142 65c4cc65-6c06-0410-ace0-fbb531ad65f3