Asterisk - The Open Source Telephony Project
18.5.0
|
Asterisk Logger. More...
#include "asterisk.h"
#include <syslog.h>
#include <signal.h>
#include <time.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "asterisk/_private.h"
#include "asterisk/module.h"
#include "asterisk/paths.h"
#include "asterisk/logger.h"
#include "asterisk/logger_category.h"
#include "asterisk/lock.h"
#include "asterisk/channel.h"
#include "asterisk/config.h"
#include "asterisk/term.h"
#include "asterisk/cli.h"
#include "asterisk/utils.h"
#include "asterisk/manager.h"
#include "asterisk/astobj2.h"
#include "asterisk/threadstorage.h"
#include "asterisk/strings.h"
#include "asterisk/pbx.h"
#include "asterisk/app.h"
#include "asterisk/buildinfo.h"
#include "asterisk/ast_version.h"
#include "asterisk/backtrace.h"
#include "asterisk/json.h"
Go to the source code of this file.
Data Structures | |
struct | logchannel |
struct | logchannels |
struct | logformatter |
struct | logmsg |
struct | logmsgs |
struct | verb_console |
struct | verb_consoles |
Macros | |
#define | FORMATL "%-35.35s %-8.8s %-10.10s %-9.9s " |
#define | LOG_BUF_INIT_SIZE 256 |
#define | LOTS_O_SPACES " " |
#define | VERBOSE_BUF_INIT_SIZE 256 |
Enumerations | |
enum | logmsgtypes { LOGMSG_NORMAL = 0, LOGMSG_VERBOSE } |
enum | logtypes { LOGTYPE_SYSLOG, LOGTYPE_FILE, LOGTYPE_CONSOLE } |
enum | rotatestrategy { NONE = 0, SEQUENTIAL = 1 << 0, ROTATE = 1 << 1, TIMESTAMP = 1 << 2 } |
Functions | |
void | __ast_trace (const char *file, int line, const char *func, enum ast_trace_indent_type indent_type, unsigned long new_indent, const char *format,...) |
void | __ast_verbose (const char *file, int line, const char *func, int level, const char *fmt,...) |
Send a verbose message (based on verbose level) More... | |
void | __ast_verbose_ap (const char *file, int line, const char *func, int level, ast_callid callid, const char *fmt, va_list ap) |
void | __ast_verbose_callid (const char *file, int line, const char *func, int level, ast_callid callid, const char *fmt,...) |
Send a verbose message (based on verbose level) with deliberately specified callid. More... | |
static void | __init_log_buf (void) |
static void | __init_my_verb_console (void) |
static void | __init_unique_callid (void) |
static void | __init_verbose_buf (void) |
static void | __init_verbose_build_buf (void) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
unsigned long | _ast_trace_dec_indent (void) |
Decrement the indent level. More... | |
unsigned long | _ast_trace_get_indent (void) |
Get the current indent level. More... | |
unsigned long | _ast_trace_inc_indent (void) |
Increment the indent level. More... | |
void | _ast_trace_set_indent (unsigned long indent) |
Set the current indent level. More... | |
static void | _handle_SIGXFSZ (int sig) |
void | ast_callid_strnprint (char *buffer, size_t buffer_size, ast_callid callid) |
copy a string representation of the callid into a target string More... | |
int | ast_callid_threadassoc_add (ast_callid callid) |
Adds a known callid to thread storage of the calling thread. More... | |
int | ast_callid_threadassoc_change (ast_callid callid) |
Sets what is stored in the thread storage to the given callid if it does not match what is already there. More... | |
int | ast_callid_threadassoc_remove (void) |
Removes callid from thread storage of the calling thread. More... | |
int | ast_callid_threadstorage_auto (ast_callid *callid) |
Checks thread storage for a callid and stores a reference if it exists. If not, then a new one will be created, bound to the thread, and a reference to it will be stored. More... | |
void | ast_callid_threadstorage_auto_clean (ast_callid callid, int callid_created) |
Use in conjunction with ast_callid_threadstorage_auto. Cleans up the references and if the callid was created by threadstorage_auto, unbinds the callid from the threadstorage. More... | |
void | ast_child_verbose (int level, const char *fmt,...) |
ast_callid | ast_create_callid (void) |
factory function to create a new uniquely identifying callid. More... | |
int | ast_dynamic_logger_level (const char *name) |
Checks if a dynamic logger level exists. More... | |
void | ast_init_logger_for_socket_console (void) |
load logger.conf configuration for console socket connections More... | |
int | ast_is_logger_initialized (void) |
Test if logger is initialized. More... | |
void | ast_log (int level, const char *file, int line, const char *function, const char *fmt,...) |
Used for sending a log message This is the standard logger function. Probably the only way you will invoke it would be something like this: ast_log(AST_LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?\n", "flux capacitor", 10); where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to. These are implemented as macros, that will provide the function with the needed arguments. More... | |
void | ast_log_ap (int level, const char *file, int line, const char *function, const char *fmt, va_list ap) |
void | ast_log_backtrace (void) |
Log a backtrace of the current thread's execution stack to the Asterisk log. More... | |
void | ast_log_callid (int level, const char *file, int line, const char *function, ast_callid callid, const char *fmt,...) |
Used for sending a log message with a known call_id This is a modified logger function which is functionally identical to the above logger function, it just include a call_id argument as well. If NULL is specified here, no attempt will be made to join the log message with a call_id. More... | |
static void | ast_log_full (int level, int sublevel, const char *file, int line, const char *function, ast_callid callid, const char *fmt, va_list ap) |
send log messages to syslog and/or the console More... | |
void | ast_log_safe (int level, const char *file, int line, const char *function, const char *fmt,...) |
Used for sending a log message with protection against recursion. More... | |
int | ast_logger_create_channel (const char *log_channel, const char *components) |
Create a log channel. More... | |
int | ast_logger_get_channels (int(*logentry)(const char *channel, const char *type, const char *status, const char *configuration, void *data), void *data) |
Retrieve the existing log channels. More... | |
const char * | ast_logger_get_dateformat (void) |
Get the logger configured date format. More... | |
int | ast_logger_get_queue_limit (void) |
Get the maximum number of messages allowed in the processing queue. More... | |
int | ast_logger_register_level (const char *name) |
Register a new logger level. More... | |
int | ast_logger_remove_channel (const char *log_channel) |
Delete the specified log channel. More... | |
int | ast_logger_rotate () |
Reload logger while rotating log files. More... | |
int | ast_logger_rotate_channel (const char *log_channel) |
Rotate the specified log channel. More... | |
void | ast_logger_set_queue_limit (int queue_limit) |
Set the maximum number of messages allowed in the processing queue. More... | |
void | ast_logger_unregister_level (const char *name) |
Unregister a previously registered logger level. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
void | ast_queue_log (const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt,...) |
ast_callid | ast_read_threadstorage_callid (void) |
extracts the callerid from the thread More... | |
AST_THREADSTORAGE_RAW (in_safe_log) | |
AST_THREADSTORAGE_RAW (trace_indent) | |
int | ast_verb_console_get (void) |
Get this thread's console verbosity level. More... | |
void | ast_verb_console_register (int *level) |
Register this thread's console verbosity level pointer. More... | |
void | ast_verb_console_set (int verb_level) |
Set this thread's console verbosity level. More... | |
void | ast_verb_console_unregister (void) |
Unregister this thread's console verbosity level. More... | |
void | ast_verb_update (void) |
Re-evaluate the system max verbosity level (ast_verb_sys_level). More... | |
void | close_logger (void) |
static struct logchannel * | find_logchannel (const char *channel) |
Find a particular logger channel by name. More... | |
static int | format_log_default (struct logchannel *chan, struct logmsg *msg, char *buf, size_t size) |
static int | format_log_json (struct logchannel *channel, struct logmsg *msg, char *buf, size_t size) |
static struct logmsg * | format_log_message (int level, int sublevel, const char *file, int line, const char *function, ast_callid callid, const char *fmt,...) |
static struct logmsg * | format_log_message_ap (int level, int sublevel, const char *file, int line, const char *function, ast_callid callid, const char *fmt, va_list ap) |
static int | format_log_plain (struct logchannel *chan, struct logmsg *msg, char *buf, size_t size) |
static char * | handle_logger_add_channel (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_logger_reload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_logger_remove_channel (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_logger_rotate (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_logger_set_level (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_logger_show_channels (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
CLI command to show logging system configuration. More... | |
int | init_logger (void) |
static int | init_logger_chain (const char *altconf) |
Read config, setup channels. More... | |
static int | load_module (void) |
static int | logger_add_verbose_magic (struct logmsg *logmsg, char *buf, size_t size) |
static void | logger_print_normal (struct logmsg *logmsg) |
Print a normal log message to the channels. More... | |
static void | logger_queue_init (void) |
static int | logger_queue_restart (int queue_rotate) |
static int | logger_queue_rt_start (void) |
void | logger_queue_start (void) |
Start the ast_queue_log() logger. More... | |
static int | logger_register_level (const char *name) |
static void * | logger_thread (void *data) |
Actual logging thread. More... | |
static void | logmsg_free (struct logmsg *msg) |
static void | make_components (struct logchannel *chan) |
static void | make_filename (const char *channel, char *filename, size_t size) |
create the filename that will be used for a logger channel. More... | |
static struct logchannel * | make_logchannel (const char *channel, const char *components, int lineno, int dynamic) |
static int | reload_logger (int rotate, const char *altconf) |
static int | reload_module (void) |
static int | rotate_file (const char *filename) |
static int | unload_module (void) |
static void | update_logchannels (void) |
static void | verb_console_free (void *v_console) |
static void | verb_console_unregister (struct verb_console *console) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "Logger" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_module, .load_pri = 0, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_cli_entry | cli_logger [] |
static int | close_logger_thread = 0 |
static const int | colors [NUMLOGLEVELS] |
Colors used in the console for logging. More... | |
static char | dateformat [256] = "%b %e %T" |
static int | display_callids |
static char | exec_after_rotate [256] = "" |
static int | filesize_reload_needed |
static unsigned int | global_logmask = 0xFFFF |
static struct sigaction | handle_SIGXFSZ |
static unsigned int | high_water_alert |
static char | hostname [MAXHOSTNAMELEN] |
static char * | levels [NUMLOGLEVELS] |
Logging channels used in the Asterisk logging system. More... | |
static struct ast_threadstorage | log_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_log_buf , .custom_init = NULL , } |
static struct logchannels | logchannels = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static ast_cond_t | logcond |
struct { | |
unsigned int queue_adaptive_realtime:1 | |
unsigned int queue_log:1 | |
unsigned int queue_log_realtime_use_gmt:1 | |
unsigned int queue_log_to_file:1 | |
} | logfiles = { 1 } |
static struct logformatter | logformatter_default |
static struct logformatter | logformatter_json |
static struct logformatter | logformatter_plain |
static int | logger_initialized |
static int | logger_messages_discarded |
static int | logger_queue_limit = 1000 |
static int | logger_queue_size |
static struct logmsgs | logmsgs = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , } |
static pthread_t | logthread = AST_PTHREADT_NULL |
static struct ast_threadstorage | my_verb_console = { .once = PTHREAD_ONCE_INIT , .key_init = __init_my_verb_console , .custom_init = NULL , } |
static volatile int | next_unique_callid = 1 |
static FILE * | qlog |
static char | queue_log_name [256] = QUEUELOG |
static int | queuelog_init |
static enum rotatestrategy | rotatestrategy = SEQUENTIAL |
static struct ast_threadstorage | unique_callid = { .once = PTHREAD_ONCE_INIT , .key_init = __init_unique_callid , .custom_init = NULL , } |
static struct verb_consoles | verb_consoles = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static ast_mutex_t | verb_update_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static struct ast_threadstorage | verbose_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_verbose_buf , .custom_init = NULL , } |
static struct ast_threadstorage | verbose_build_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_verbose_build_buf , .custom_init = NULL , } |
#define FORMATL "%-35.35s %-8.8s %-10.10s %-9.9s " |
Referenced by handle_logger_show_channels().
#define LOG_BUF_INIT_SIZE 256 |
Definition at line 257 of file logger.c.
Referenced by format_log_message_ap().
#define LOTS_O_SPACES " " |
Definition at line 2375 of file logger.c.
Referenced by __ast_trace().
#define VERBOSE_BUF_INIT_SIZE 256 |
Definition at line 254 of file logger.c.
Referenced by logger_add_verbose_magic().
enum logmsgtypes |
Enumerator | |
---|---|
LOGMSG_NORMAL | |
LOGMSG_VERBOSE |
Definition at line 160 of file logger.c.
enum logtypes |
Enumerator | |
---|---|
LOGTYPE_SYSLOG | |
LOGTYPE_FILE | |
LOGTYPE_CONSOLE |
enum rotatestrategy |
Enumerator | |
---|---|
NONE | |
SEQUENTIAL | |
ROTATE | |
TIMESTAMP |
void __ast_trace | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
enum ast_trace_indent_type | indent_type, | ||
unsigned long | new_indent, | ||
const char * | format, | ||
... | |||
) |
Definition at line 2405 of file logger.c.
References __LOG_TRACE, ast_free, ast_log_full(), ast_skip_blanks(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_threadstorage_get_ptr(), ast_threadstorage_set_ptr(), AST_TRACE_INDENT_DEC_AFTER, AST_TRACE_INDENT_DEC_BEFORE, AST_TRACE_INDENT_INC_AFTER, AST_TRACE_INDENT_INC_BEFORE, AST_TRACE_INDENT_NONE, AST_TRACE_INDENT_PROVIDED, AST_TRACE_INDENT_SAME, LOTS_O_SPACES, NULL, and S_OR.
void __ast_verbose | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
int | level, | ||
const char * | fmt, | ||
... | |||
) |
Send a verbose message (based on verbose level)
This works like ast_log, but prints verbose messages to the console depending on verbosity level set.
ast_verbose(VERBOSE_PREFIX_3 "Whatever %s is happening\n", "nothing");
This will print the message to the console if the verbose level is set to a level >= 3
Note the absence of a comma after the VERBOSE_PREFIX_3. This is important. VERBOSE_PREFIX_1 through VERBOSE_PREFIX_4 are defined.
Definition at line 2198 of file logger.c.
References __ast_verbose_ap(), and ast_read_threadstorage_callid().
void __ast_verbose_ap | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
int | level, | ||
ast_callid | callid, | ||
const char * | fmt, | ||
va_list | ap | ||
) |
Definition at line 2193 of file logger.c.
References __LOG_VERBOSE, and ast_log_full().
Referenced by __ast_verbose(), __ast_verbose_callid(), and ast_log_ap().
void __ast_verbose_callid | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
int | level, | ||
ast_callid | callid, | ||
const char * | fmt, | ||
... | |||
) |
Send a verbose message (based on verbose level) with deliberately specified callid.
just like __ast_verbose, only __ast_verbose_callid allows you to specify which callid is being used for the log without needing to bind it to a thread. NULL is a valid argument for this function and will allow you to specify that a log will never display a call id even when there is a call id bound to the thread.
Definition at line 2210 of file logger.c.
References __ast_verbose_ap().
|
static |
unsigned long _ast_trace_dec_indent | ( | void | ) |
Decrement the indent level.
Definition at line 2396 of file logger.c.
References ast_threadstorage_get_ptr(), and ast_threadstorage_set_ptr().
unsigned long _ast_trace_get_indent | ( | void | ) |
Get the current indent level.
Definition at line 2377 of file logger.c.
References ast_threadstorage_get_ptr().
unsigned long _ast_trace_inc_indent | ( | void | ) |
Increment the indent level.
Definition at line 2387 of file logger.c.
References ast_threadstorage_get_ptr(), and ast_threadstorage_set_ptr().
void _ast_trace_set_indent | ( | unsigned long | indent | ) |
Set the current indent level.
indent | The new indent level |
Definition at line 2382 of file logger.c.
References ast_threadstorage_set_ptr().
|
static |
void ast_callid_strnprint | ( | char * | buffer, |
size_t | buffer_size, | ||
ast_callid | callid | ||
) |
copy a string representation of the callid into a target string
buffer | destination of callid string (should be able to store 13 characters or more) |
buffer_size | maximum writable length of the string (Less than 13 will result in truncation) |
callid | Callid for which string is being requested |
Definition at line 1952 of file logger.c.
Referenced by ast_channel_callid_set(), func_channel_read(), handle_showchan(), and iax_pvt_callid_new().
int ast_callid_threadassoc_add | ( | ast_callid | callid | ) |
Adds a known callid to thread storage of the calling thread.
0 | - success |
non-zero | - failure |
Definition at line 1984 of file logger.c.
References ast_log(), ast_threadstorage_get(), LOG_ERROR, and unique_callid.
Referenced by __analog_ss_thread(), __ast_pbx_run(), ast_callid_threadstorage_auto(), async_dial(), attended_transfer_monitor_thread(), bridge_channel_control_thread(), bridge_channel_depart_thread(), bridge_channel_ind_thread(), handle_request_do(), jingle_action_hook(), jingle_outgoing_hook(), mixmonitor_thread(), socket_process_helper(), and softmix_mixing_thread().
int ast_callid_threadassoc_change | ( | ast_callid | callid | ) |
Sets what is stored in the thread storage to the given callid if it does not match what is already there.
0 | - success |
non-zero | - failure |
Definition at line 1971 of file logger.c.
References ast_threadstorage_get(), and unique_callid.
Referenced by autoservice_run(), and bridge_manager_service().
int ast_callid_threadassoc_remove | ( | void | ) |
Removes callid from thread storage of the calling thread.
0 | - success |
non-zero | - failure |
Definition at line 2003 of file logger.c.
References ast_threadstorage_get(), and unique_callid.
Referenced by ast_callid_threadstorage_auto_clean(), attended_transfer_monitor_thread(), handle_request_do(), jingle_action_hook(), jingle_outgoing_hook(), and socket_process().
int ast_callid_threadstorage_auto | ( | ast_callid * | callid | ) |
Checks thread storage for a callid and stores a reference if it exists. If not, then a new one will be created, bound to the thread, and a reference to it will be stored.
callid | pointer to store the callid |
0 | - callid was found |
1 | - callid was created |
-1 | - the function failed somehow (presumably memory problems) |
Definition at line 2020 of file logger.c.
References ast_callid_threadassoc_add(), ast_create_callid(), ast_read_threadstorage_callid(), and tmp().
Referenced by __analog_handle_event(), analog_handle_init_event(), dahdi_handle_event(), dahdi_request(), do_monitor(), handle_clear_alarms(), handle_init_event(), mwi_thread(), my_new_analog_ast_channel(), and my_on_hook().
void ast_callid_threadstorage_auto_clean | ( | ast_callid | callid, |
int | callid_created | ||
) |
Use in conjunction with ast_callid_threadstorage_auto. Cleans up the references and if the callid was created by threadstorage_auto, unbinds the callid from the threadstorage.
callid | The callid set by ast_callid_threadstorage_auto |
callid_created | The integer returned through ast_callid_threadstorage_auto |
Definition at line 2042 of file logger.c.
References ast_callid_threadassoc_remove().
Referenced by __analog_handle_event(), analog_handle_init_event(), dahdi_handle_event(), dahdi_new_callid_clean(), dahdi_request(), do_monitor(), handle_clear_alarms(), handle_init_event(), and mwi_thread().
void ast_child_verbose | ( | int | level, |
const char * | fmt, | ||
... | |||
) |
Definition at line 850 of file logger.c.
References ast_free, ast_malloc, and NULL.
Referenced by launch_script().
ast_callid ast_create_callid | ( | void | ) |
factory function to create a new uniquely identifying callid.
The | call id |
Definition at line 1957 of file logger.c.
References ast_atomic_fetchadd_int(), and next_unique_callid.
Referenced by __ast_pbx_run(), __find_call(), ast_callid_threadstorage_auto(), iax_pvt_callid_new(), and jingle_alloc().
int ast_dynamic_logger_level | ( | const char * | name | ) |
Checks if a dynamic logger level exists.
name | The name of the dynamic level for which to check existence |
-1 | if no such dynamic level exists |
non-zero | negative to be used with ast_log_dynamic_level for sending messages to this level |
Definition at line 2514 of file logger.c.
References ARRAY_LEN, AST_RWLIST_UNLOCK, and AST_RWLIST_WRLOCK.
Referenced by log_exec().
void ast_init_logger_for_socket_console | ( | void | ) |
load logger.conf configuration for console socket connections
Definition at line 684 of file logger.c.
References ast_config_destroy(), ast_config_load2(), ast_copy_string(), ast_variable_retrieve(), CONFIG_STATUS_FILEINVALID, and dateformat.
Referenced by ast_remotecontrol().
int ast_is_logger_initialized | ( | void | ) |
Test if logger is initialized.
true | if the logger is initialized |
Definition at line 1841 of file logger.c.
References logger_initialized.
Referenced by check_init().
void ast_log | ( | int | level, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
const char * | fmt, | ||
... | |||
) |
Used for sending a log message This is the standard logger function. Probably the only way you will invoke it would be something like this: ast_log(AST_LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?\n", "flux capacitor", 10); where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to. These are implemented as macros, that will provide the function with the needed arguments.
level | Type of log event |
file | Will be provided by the AST_LOG_* macro |
line | Will be provided by the AST_LOG_* macro |
function | Will be provided by the AST_LOG_* macro |
fmt | This is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-) |
Definition at line 2101 of file logger.c.
References ast_log_ap().
Referenced by ast_callid_threadassoc_add(), ast_log_backtrace(), init_logger(), logger_queue_init(), logger_queue_restart(), logger_register_level(), and rotate_file().
void ast_log_ap | ( | int | level, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
const char * | fmt, | ||
va_list | ap | ||
) |
Definition at line 2110 of file logger.c.
References __ast_verbose_ap(), __LOG_VERBOSE, ast_log_full(), ast_read_threadstorage_callid(), and logmsg::callid.
Referenced by ast_log(), and module_load_error().
void ast_log_backtrace | ( | void | ) |
Log a backtrace of the current thread's execution stack to the Asterisk log.
Definition at line 2158 of file logger.c.
References __LOG_ERROR, ast_bt::addresses, ast_bt_create, ast_bt_destroy, ast_bt_free_symbols, ast_bt_get_symbols, ast_free, ast_log(), ast_log_safe(), ast_str_append(), ast_str_buffer(), ast_str_create, AST_VECTOR_GET, AST_VECTOR_SIZE, buf, LOG_ERROR, LOG_WARNING, NULL, and ast_bt::num_frames.
Referenced by __ast_assert_failed(), ast_json_vpack(), ast_sched_del(), and AST_TEST_DEFINE().
void ast_log_callid | ( | int | level, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
ast_callid | callid, | ||
const char * | fmt, | ||
... | |||
) |
Used for sending a log message with a known call_id This is a modified logger function which is functionally identical to the above logger function, it just include a call_id argument as well. If NULL is specified here, no attempt will be made to join the log message with a call_id.
level | Type of log event |
file | Will be provided by the AST_LOG_* macro |
line | Will be provided by the AST_LOG_* macro |
function | Will be provided by the AST_LOG_* macro |
callid | This is the ast_callid that is associated with the log message. May be NULL. |
fmt | This is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-) |
Definition at line 2149 of file logger.c.
References ast_log_full().
Referenced by ast_channel_destructor(), and dahdi_cc_callback().
|
static |
send log messages to syslog and/or the console
Definition at line 2053 of file logger.c.
References __LOG_VERBOSE, __LOG_WARNING, ast_cond_signal, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_UNLOCK, ast_opt_exec, ast_opt_remote, AST_PTHREADT_NULL, format_log_message(), format_log_message_ap(), high_water_alert, logmsg::list, logger_messages_discarded, logger_print_normal(), logger_queue_limit, logger_queue_size, logmsg_free(), and NULL.
Referenced by __ast_trace(), __ast_verbose_ap(), ast_log_ap(), ast_log_callid(), and ast_log_safe().
void ast_log_safe | ( | int | level, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
const char * | fmt, | ||
... | |||
) |
Used for sending a log message with protection against recursion.
Definition at line 2123 of file logger.c.
References ast_log_full(), ast_read_threadstorage_callid(), ast_threadstorage_get_ptr(), ast_threadstorage_set_ptr(), logmsg::callid, and NULL.
Referenced by __ast_str_helper(), and ast_log_backtrace().
int ast_logger_create_channel | ( | const char * | log_channel, |
const char * | components | ||
) |
Create a log channel.
log_channel | Log channel to create |
components | Logging config levels to add to the log channel |
Definition at line 1419 of file logger.c.
References AST_LOGGER_ALLOC_ERROR, AST_LOGGER_DECLINE, AST_LOGGER_FAILURE, AST_LOGGER_SUCCESS, AST_RWLIST_INSERT_HEAD, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_strlen_zero, find_logchannel(), global_logmask, logchannel::list, logchannel::logmask, and make_logchannel().
Referenced by ast_ari_asterisk_add_log(), handle_cli_queue_test(), and handle_logger_add_channel().
int ast_logger_get_channels | ( | int(*)(const char *channel, const char *type, const char *status, const char *configuration, void *data) | logentry, |
void * | data | ||
) |
Retrieve the existing log channels.
logentry | A callback to an updater function |
data | Data passed into the callback for manipulation |
For each of the logging channels, logentry will be executed with the channel file name, log type, status of the log, and configuration levels.
0 | on success |
1 | on failure |
-2 | on allocation error |
Definition at line 1336 of file logger.c.
References ARRAY_LEN, ast_free, AST_LOGGER_ALLOC_ERROR, AST_LOGGER_FAILURE, AST_LOGGER_SUCCESS, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_reset(), logchannel::disabled, logchannel::filename, logchannel::logmask, LOGTYPE_CONSOLE, LOGTYPE_SYSLOG, NULL, and logchannel::type.
Referenced by ast_ari_asterisk_list_log_channels().
const char* ast_logger_get_dateformat | ( | void | ) |
Get the logger configured date format.
The | date format string |
Definition at line 2577 of file logger.c.
References dateformat.
Referenced by set_header().
int ast_logger_get_queue_limit | ( | void | ) |
Get the maximum number of messages allowed in the processing queue.
Definition at line 2587 of file logger.c.
References logger_queue_limit.
Referenced by handle_cli_queue_test().
int ast_logger_register_level | ( | const char * | name | ) |
Register a new logger level.
name | The name of the level to be registered |
-1 | if an error occurs |
non-zero | level to be used with ast_log for sending messages to this level |
Definition at line 2503 of file logger.c.
References AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, available(), and logger_register_level().
Referenced by handle_cli_dynamic_level_test(), handle_cli_performance_test(), handle_cli_queue_test(), and load_module().
int ast_logger_remove_channel | ( | const char * | log_channel | ) |
Delete the specified log channel.
log_channel | The log channel to delete |
Definition at line 1485 of file logger.c.
References ast_free, AST_LOGGER_FAILURE, AST_LOGGER_SUCCESS, AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, logchannel::dynamic, logchannel::fileptr, find_logchannel(), logchannel::list, and NULL.
Referenced by ast_ari_asterisk_delete_log(), handle_cli_queue_test(), and handle_logger_remove_channel().
int ast_logger_rotate | ( | void | ) |
Reload logger while rotating log files.
Definition at line 1254 of file logger.c.
References NULL, and reload_logger().
Referenced by action_loggerrotate().
int ast_logger_rotate_channel | ( | const char * | log_channel | ) |
Rotate the specified log channel.
log_channel | The log channel to rotate |
Definition at line 1259 of file logger.c.
References ast_config_AST_LOG_DIR, AST_LOGGER_FAILURE, AST_LOGGER_SUCCESS, ast_mkdir(), AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, logchannel::disabled, EVENT_FLAG_SYSTEM, logchannel::filename, logchannel::fileptr, init_logger_chain(), logchannel::list, make_filename(), manager_event, NULL, PATH_MAX, and rotate_file().
Referenced by ast_ari_asterisk_rotate_log().
void ast_logger_set_queue_limit | ( | int | queue_limit | ) |
Set the maximum number of messages allowed in the processing queue.
queue_limit |
Definition at line 2582 of file logger.c.
References logger_queue_limit.
Referenced by handle_cli_queue_test().
void ast_logger_unregister_level | ( | const char * | name | ) |
Unregister a previously registered logger level.
name | The name of the level to be unregistered |
Definition at line 2536 of file logger.c.
References ARRAY_LEN, ast_debug, ast_free, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, global_logmask, NULL, and update_logchannels().
Referenced by handle_cli_dynamic_level_test(), handle_cli_performance_test(), handle_cli_queue_test(), load_module(), and unload_module().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
void ast_queue_log | ( | const char * | queuename, |
const char * | callid, | ||
const char * | agent, | ||
const char * | event, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 894 of file logger.c.
References args, AST_APP_ARG, ast_check_realtime(), AST_DECLARE_APP_ARGS, ast_localtime(), AST_NONSTANDARD_APP_ARGS, ast_realtime_require_field(), AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_store_realtime(), ast_strftime(), ast_tvnow(), logfiles, logger_initialized, logger_queue_start(), NULL, queuelog_init, RQ_CHAR, S_OR, and SENTINEL.
Referenced by aqm_exec(), find_queue_by_name_rt(), handle_blind_transfer(), handle_hangup(), handle_queue_add_member(), handle_queue_remove_member(), log_attended_transfer(), logger_queue_start(), manager_add_queue_member(), manager_queue_log_custom(), manager_remove_queue_member(), ql_exec(), queue_agent_cb(), queue_exec(), qupd_exec(), reload_logger(), rna(), rqm_exec(), rt_handle_member_record(), set_member_paused(), set_member_penalty_help_members(), set_queue_member_pause(), set_queue_member_ringinuse(), try_calling(), update_realtime_members(), wait_for_answer(), and wait_our_turn().
ast_callid ast_read_threadstorage_callid | ( | void | ) |
extracts the callerid from the thread
Non-zero | Call id related to the thread |
0 | if no call_id is present in the thread |
Definition at line 1962 of file logger.c.
References ast_threadstorage_get(), and unique_callid.
Referenced by __ast_pbx_run(), __ast_verbose(), ast_callid_threadstorage_auto(), ast_dial_run(), ast_log_ap(), ast_log_safe(), bridge_channel_internal_join(), bridge_impart_internal(), common_recall_channel_setup(), iax2_request(), jingle_alloc(), launch_monitor_thread(), local_request_with_stream_topology(), media_request_helper(), sip_request_call(), and socket_process().
AST_THREADSTORAGE_RAW | ( | in_safe_log | ) |
Referenced by update_logchannels().
AST_THREADSTORAGE_RAW | ( | trace_indent | ) |
int ast_verb_console_get | ( | void | ) |
Get this thread's console verbosity level.
verbosity | level of the console. |
Definition at line 2323 of file logger.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_threadstorage_get(), verb_console::level, my_verb_console, and option_verbose.
Referenced by handle_show_settings(), and handle_verbose().
void ast_verb_console_register | ( | int * | level | ) |
Register this thread's console verbosity level pointer.
level | Where the verbose level value is. |
Definition at line 2296 of file logger.c.
References AST_RWLIST_INSERT_HEAD, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_threadstorage_get(), ast_verb_update(), verb_console::level, and my_verb_console.
Referenced by netconsole().
void ast_verb_console_set | ( | int | verb_level | ) |
Set this thread's console verbosity level.
verb_level | New level to set. |
Definition at line 2341 of file logger.c.
References AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_threadstorage_get(), ast_verb_update(), verb_console::level, my_verb_console, and option_verbose.
Referenced by handle_verbose().
void ast_verb_console_unregister | ( | void | ) |
Unregister this thread's console verbosity level.
Definition at line 2312 of file logger.c.
References ast_threadstorage_get(), my_verb_console, and verb_console_unregister().
Referenced by netconsole().
void ast_verb_update | ( | void | ) |
Re-evaluate the system max verbosity level (ast_verb_sys_level).
Definition at line 2232 of file logger.c.
References AST_LIST_TRAVERSE, ast_mutex_lock, ast_mutex_unlock, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_verb_sys_level, verb_console::level, option_verbose, verb_update_lock, and logchannel::verbosity.
Referenced by ast_verb_console_register(), ast_verb_console_set(), init_logger(), reload_logger(), and verb_console_unregister().
void close_logger | ( | void | ) |
Provided by logger.c
Definition at line 1912 of file logger.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), ast_cond_signal, ast_free, AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_logger_category_unload(), AST_PTHREADT_NULL, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, logchannel::fileptr, logchannel::list, logger_initialized, and NULL.
Referenced by really_quit().
|
static |
Find a particular logger channel by name.
channel | The name of the logger channel to find |
non-NULL | The corresponding logger channel |
NULL | Unable to find a logger channel with that particular name |
Definition at line 601 of file logger.c.
References AST_RWLIST_TRAVERSE, logchannel::filename, logchannel::list, make_filename(), NULL, and PATH_MAX.
Referenced by ast_logger_create_channel(), and ast_logger_remove_channel().
|
static |
Definition at line 365 of file logger.c.
References __LOG_VERBOSE, ast_strlen_zero, logmsg::callid, COLOR_BRWHITE, COLORIZE, COLORIZE_FMT, logmsg::date, logmsg::file, logmsg::function, logmsg::level, logmsg::level_name, logmsg::line, logger_add_verbose_magic(), LOGTYPE_CONSOLE, LOGTYPE_FILE, LOGTYPE_SYSLOG, logmsg::lwp, logmsg::message, term_strip(), and logchannel::type.
|
static |
Definition at line 259 of file logger.c.
References ast_config_AST_SYSTEM_NAME, ast_copy_string(), ast_json_dump_string, ast_json_free(), ast_json_pack(), ast_json_unref(), logmsg::callid, logmsg::date, logmsg::file, logmsg::function, logmsg::level_name, logmsg::line, logmsg::lwp, logmsg::message, S_OR, str, and term_strip().
|
static |
Definition at line 1746 of file logger.c.
References format_log_message_ap().
Referenced by ast_log_full(), and logger_thread().
|
static |
Definition at line 1682 of file logger.c.
References __LOG_VERBOSE, ast_calloc_with_stringfields, AST_DYNSTR_BUILD_FAILED, ast_ends_with(), ast_get_tid(), ast_localtime(), ast_str_append(), ast_str_buffer(), ast_str_set_va(), ast_str_thread_get(), ast_strftime(), ast_string_field_set, ast_tvnow(), buf, logmsg::callid, dateformat, display_callids, logmsg::level, logmsg::line, log_buf, LOG_BUF_INIT_SIZE, LOGMSG_NORMAL, LOGMSG_VERBOSE, logmsg::lwp, NULL, logmsg::sublevel, and logmsg::type.
Referenced by ast_log_full(), and format_log_message().
|
static |
Definition at line 429 of file logger.c.
References ast_strlen_zero, logmsg::callid, logmsg::date, logmsg::file, logmsg::function, logmsg::level, logmsg::level_name, logmsg::line, LOGTYPE_CONSOLE, LOGTYPE_FILE, LOGTYPE_SYSLOG, logmsg::lwp, logmsg::message, term_strip(), and logchannel::type.
|
static |
Definition at line 1449 of file logger.c.
References ast_cli_args::argc, ast_cli_args::argv, ast_cli(), AST_LOGGER_ALLOC_ERROR, ast_logger_create_channel(), AST_LOGGER_DECLINE, AST_LOGGER_FAILURE, AST_LOGGER_SUCCESS, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1216 of file logger.c.
References ast_cli_args::argc, ast_cli_args::argv, ast_cli(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, reload_logger(), and ast_cli_entry::usage.
|
static |
Definition at line 1510 of file logger.c.
References ast_cli_args::argc, ast_cli_args::argv, ast_cli(), AST_LOGGER_FAILURE, ast_logger_remove_channel(), AST_LOGGER_SUCCESS, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_strdup, ast_strlen_zero, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, logchannel::dynamic, ast_cli_args::fd, logchannel::filename, logchannel::list, ast_cli_args::n, NULL, ast_cli_args::pos, and ast_cli_entry::usage.
|
static |
Definition at line 1235 of file logger.c.
References ast_cli(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, reload_logger(), and ast_cli_entry::usage.
|
static |
Definition at line 1294 of file logger.c.
References ast_cli_args::argc, ast_cli_args::argv, ARRAY_LEN, ast_cli(), ast_console_toggle_loglevel(), AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_true(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, state, and ast_cli_entry::usage.
|
static |
CLI command to show logging system configuration.
Definition at line 1379 of file logger.c.
References ARRAY_LEN, ast_cli(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, logchannel::disabled, ast_cli_args::fd, logchannel::filename, FORMATL, logchannel::formatter, logchannel::list, logger_queue_limit, logchannel::logmask, LOGTYPE_CONSOLE, LOGTYPE_SYSLOG, logformatter::name, NULL, logchannel::type, and ast_cli_entry::usage.
int init_logger | ( | void | ) |
Provided by logger.c
Definition at line 1870 of file logger.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_cond_destroy, ast_cond_init, ast_config_AST_LOG_DIR, ast_log(), ast_logger_category_load(), ast_mkdir(), ast_mutex_destroy, ast_mutex_init, ast_pthread_create, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb_update(), init_logger_chain(), logmsgs::lock, LOG_ERROR, logger_initialized, logger_thread(), and NULL.
Referenced by asterisk_daemon().
|
static |
Read config, setup channels.
altconf | Alternate configuration file to read. |
0 | Success |
-1 | No config found or Failed |
Definition at line 710 of file logger.c.
References __LOG_ERROR, ast_config_destroy(), ast_config_load2(), ast_console_puts_mutable(), ast_copy_string(), ast_free, AST_RWLIST_INSERT_HEAD, AST_RWLIST_REMOVE_HEAD, ast_strdup, ast_strdupa, ast_true(), ast_variable_browse(), ast_variable_retrieve(), CONFIG_STATUS_FILEINVALID, dateformat, display_callids, errno, exec_after_rotate, global_logmask, hostname, ast_variable::lineno, logfiles, logger_queue_limit, logger_register_level(), logchannel::logmask, make_logchannel(), ast_variable::name, ast_variable::next, NONE, NULL, queue_log_name, QUEUELOG, ROTATE, S_OR, SEQUENTIAL, strsep(), TIMESTAMP, ast_variable::value, and var.
Referenced by ast_logger_rotate_channel(), init_logger(), and reload_logger().
|
static |
Definition at line 2602 of file logger.c.
References AST_MODFLAG_GLOBAL_SYMBOLS, AST_MODFLAG_LOAD_ORDER, AST_MODULE_INFO(), AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, reload(), reload_module(), and unload_module().
|
static |
Definition at line 319 of file logger.c.
References ast_str_append(), ast_str_append_substr(), ast_str_buffer(), ast_str_reset(), ast_str_thread_get(), logmsg::message, logmsg::sublevel, verbose_buf, VERBOSE_BUF_INIT_SIZE, VERBOSE_PREFIX_1, VERBOSE_PREFIX_2, VERBOSE_PREFIX_3, and VERBOSE_PREFIX_4.
Referenced by format_log_default().
|
static |
Print a normal log message to the channels.
Definition at line 1580 of file logger.c.
References __LOG_VERBOSE, ast_console_puts_mutable_full(), AST_RWLIST_EMPTY, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_strlen_zero, ast_syslog_priority_from_loglevel(), ast_verb, buf, logchannel::disabled, errno, EVENT_FLAG_SYSTEM, logchannel::facility, logchannel::filename, logchannel::fileptr, filesize_reload_needed, logformatter::format_log, logchannel::formatter, logmsg::level, logchannel::list, logchannel::logmask, LOGTYPE_CONSOLE, LOGTYPE_FILE, LOGTYPE_SYSLOG, manager_event, logmsg::message, NULL, option_verbose, reload_logger(), logmsg::sublevel, logchannel::type, and logchannel::verbosity.
Referenced by ast_log_full(), and logger_thread().
|
static |
Definition at line 1817 of file logger.c.
References ast_config_AST_LOG_DIR, ast_log(), ast_unload_realtime(), errno, LOG_ERROR, logfiles, logger_queue_rt_start(), PATH_MAX, and queue_log_name.
Referenced by logger_queue_start().
|
static |
Definition at line 1113 of file logger.c.
References ast_config_AST_LOG_DIR, ast_log(), errno, LOG_ERROR, logger_queue_rt_start(), NULL, PATH_MAX, queue_log_name, and rotate_file().
Referenced by reload_logger().
|
static |
Definition at line 1078 of file logger.c.
References ast_check_realtime(), ast_realtime_require_field(), logfiles, RQ_CHAR, RQ_DATETIME, and SENTINEL.
Referenced by logger_queue_init(), and logger_queue_restart().
void logger_queue_start | ( | void | ) |
Start the ast_queue_log() logger.
Definition at line 1854 of file logger.c.
References ast_assert, ast_queue_log(), AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, logger_initialized, logger_queue_init(), and queuelog_init.
Referenced by ast_queue_log(), and asterisk_daemon().
|
static |
Definition at line 2464 of file logger.c.
References ARRAY_LEN, ast_debug, ast_log(), AST_RWLIST_UNLOCK, ast_strdup, available(), LOG_WARNING, and update_logchannels().
Referenced by ast_logger_register_level(), and init_logger_chain().
|
static |
Actual logging thread.
Definition at line 1761 of file logger.c.
References __LOG_WARNING, ast_cond_wait, AST_LIST_EMPTY, AST_LIST_FIRST, AST_LIST_HEAD_INIT_NOLOCK, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_NEXT, AST_LIST_UNLOCK, format_log_message(), high_water_alert, logmsg::list, logmsgs::lock, logger_messages_discarded, logger_print_normal(), logger_queue_size, logmsg_free(), logmsg::next, and NULL.
Referenced by init_logger().
|
static |
Definition at line 182 of file logger.c.
References ast_free, and ast_string_field_free_memory.
Referenced by ast_log_full(), and logger_thread().
|
static |
Definition at line 479 of file logger.c.
References __LOG_VERBOSE, ARRAY_LEN, ast_strdupa, ast_strip(), ast_strlen_zero, logchannel::components, end, logchannel::filename, logchannel::formatter, logchannel::logmask, LOGTYPE_CONSOLE, logformatter::name, strsep(), logchannel::type, and logchannel::verbosity.
Referenced by make_logchannel(), and update_logchannels().
|
static |
create the filename that will be used for a logger channel.
channel | The name of the logger channel | |
[out] | filename | The filename for the logger channel |
size | The size of the filename buffer |
Definition at line 560 of file logger.c.
References ast_config_AST_LOG_DIR, ast_copy_string(), ast_strlen_zero, and hostname.
Referenced by ast_logger_rotate_channel(), find_logchannel(), and make_logchannel().
|
static |
Definition at line 617 of file logger.c.
References __LOG_ERROR, ast_build_date, ast_build_hostname, ast_build_machine, ast_build_os, ast_build_user, ast_calloc, ast_console_puts_mutable(), ast_free, ast_get_version(), ast_localtime(), ast_strftime(), ast_strlen_zero, ast_syslog_facility(), ast_tvnow(), logchannel::components, dateformat, logchannel::dynamic, errno, logchannel::facility, logchannel::filename, logchannel::fileptr, logchannel::lineno, LOGTYPE_CONSOLE, LOGTYPE_FILE, LOGTYPE_SYSLOG, make_components(), make_filename(), NULL, and logchannel::type.
Referenced by ast_logger_create_channel(), and init_logger_chain().
|
static |
Definition at line 1141 of file logger.c.
References ast_config_AST_LOG_DIR, ast_mkdir(), ast_queue_log(), AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_unload_realtime(), ast_verb, ast_verb_update(), logchannel::disabled, EVENT_FLAG_SYSTEM, logchannel::filename, logchannel::fileptr, filesize_reload_needed, init_logger_chain(), logchannel::list, logfiles, logger_queue_restart(), manager_event, NONE, NULL, and rotate_file().
Referenced by ast_logger_rotate(), handle_logger_reload(), handle_logger_rotate(), logger_print_normal(), and reload_module().
|
static |
Definition at line 2592 of file logger.c.
References NULL, and reload_logger().
Referenced by load_module().
|
static |
Definition at line 974 of file logger.c.
References ARRAY_LEN, ast_channel_unref, ast_dummy_channel_alloc, ast_log(), ast_safe_system(), ast_strlen_zero, buf, c, exec_after_rotate, LOG_WARNING, NONE, NULL, PATH_MAX, pbx_builtin_setvar_helper(), pbx_substitute_variables_helper(), ROTATE, SEQUENTIAL, and TIMESTAMP.
Referenced by ast_logger_rotate_channel(), logger_queue_restart(), and reload_logger().
|
static |
|
static |
Definition at line 2360 of file logger.c.
References AST_RWLIST_TRAVERSE, AST_THREADSTORAGE_RAW(), global_logmask, logchannel::list, logchannel::logmask, and make_components().
Referenced by ast_logger_unregister_level(), and logger_register_level().
|
static |
Definition at line 2285 of file logger.c.
References ast_free, and verb_console_unregister().
|
static |
Definition at line 2275 of file logger.c.
References AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and ast_verb_update().
Referenced by ast_verb_console_unregister(), and verb_console_free().
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 79 of file logger.c.
Referenced by ast_init_logger_for_socket_console(), ast_logger_get_dateformat(), build_device(), format_log_message_ap(), init_logger_chain(), and make_logchannel().
|
static |
Definition at line 89 of file logger.c.
Referenced by format_log_message_ap(), and init_logger_chain().
|
static |
Definition at line 82 of file logger.c.
Referenced by init_logger_chain(), and rotate_file().
|
static |
Definition at line 84 of file logger.c.
Referenced by _handle_SIGXFSZ(), logger_print_normal(), and reload_logger().
|
static |
Definition at line 85 of file logger.c.
Referenced by ast_logger_create_channel(), ast_logger_unregister_level(), init_logger_chain(), and update_logchannels().
|
static |
|
static |
Definition at line 96 of file logger.c.
Referenced by ast_log_full(), and logger_thread().
|
static |
Definition at line 112 of file logger.c.
Referenced by init_logger_chain(), and make_filename().
|
static |
|
static |
Definition at line 256 of file logger.c.
Referenced by format_log_message_ap().
|
static |
|
static |
struct { ... } logfiles |
Referenced by ast_queue_log(), init_logger_chain(), logger_queue_init(), logger_queue_rt_start(), and reload_logger().
|
static |
|
static |
|
static |
|
static |
Definition at line 87 of file logger.c.
Referenced by ast_is_logger_initialized(), ast_queue_log(), close_logger(), init_logger(), and logger_queue_start().
|
static |
Definition at line 95 of file logger.c.
Referenced by ast_log_full(), and logger_thread().
|
static |
Definition at line 94 of file logger.c.
Referenced by ast_log_full(), ast_logger_get_queue_limit(), ast_logger_set_queue_limit(), handle_logger_show_channels(), and init_logger_chain().
|
static |
Definition at line 91 of file logger.c.
Referenced by ast_log_full(), and logger_thread().
|
static |
|
static |
|
static |
Definition at line 2294 of file logger.c.
Referenced by ast_verb_console_get(), ast_verb_console_register(), ast_verb_console_set(), and ast_verb_console_unregister().
|
static |
Definition at line 88 of file logger.c.
Referenced by ast_create_callid().
|
static |
Definition at line 81 of file logger.c.
Referenced by init_logger_chain(), logger_queue_init(), and logger_queue_restart().
|
static |
Definition at line 86 of file logger.c.
Referenced by ast_queue_log(), and logger_queue_start().
|
static |
|
static |
Definition at line 91 of file logger.c.
Referenced by ast_callid_threadassoc_add(), ast_callid_threadassoc_change(), ast_callid_threadassoc_remove(), and ast_read_threadstorage_callid().
|
static |
|
static |
ast_verb_update() reentrancy protection lock.
Definition at line 2230 of file logger.c.
Referenced by ast_verb_update().
|
static |
Definition at line 252 of file logger.c.
Referenced by logger_add_verbose_magic().
|
static |