Apache2
|
Typedefs | |
typedef struct piped_log | piped_log |
Functions | |
void | ap_open_stderr_log (apr_pool_t *p) |
apr_status_t | ap_replace_stderr_log (apr_pool_t *p, const char *file) |
int | ap_open_logs (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s_main) |
void | ap_logs_child_init (apr_pool_t *p, server_rec *s) |
void | ap_log_error (const char *file, int line, int module_index, int level, apr_status_t status, const server_rec *s, const char *fmt,...) |
void | ap_log_perror (const char *file, int line, int module_index, int level, apr_status_t status, apr_pool_t *p, const char *fmt,...) |
void | ap_log_rerror (const char *file, int line, int module_index, int level, apr_status_t status, const request_rec *r, const char *fmt,...) |
void | ap_log_cerror (const char *file, int line, int module_index, int level, apr_status_t status, const conn_rec *c, const char *fmt,...) |
void | ap_log_cserror (const char *file, int line, int module_index, int level, apr_status_t status, const conn_rec *c, const server_rec *s, const char *fmt,...) |
void | ap_log_data (const char *file, int line, int module_index, int level, const server_rec *s, const char *label, const void *data, apr_size_t len, unsigned int flags) |
void | ap_log_rdata (const char *file, int line, int module_index, int level, const request_rec *r, const char *label, const void *data, apr_size_t len, unsigned int flags) |
void | ap_log_cdata (const char *file, int line, int module_index, int level, const conn_rec *c, const char *label, const void *data, apr_size_t len, unsigned int flags) |
void | ap_log_csdata (const char *file, int line, int module_index, int level, const conn_rec *c, const server_rec *s, const char *label, const void *data, apr_size_t len, unsigned int flags) |
void | ap_error_log2stderr (server_rec *s) |
void | ap_log_command_line (apr_pool_t *p, server_rec *s) |
void | ap_log_mpm_common (server_rec *s) |
void | ap_log_pid (apr_pool_t *p, const char *fname) |
void | ap_remove_pid (apr_pool_t *p, const char *fname) |
apr_status_t | ap_read_pid (apr_pool_t *p, const char *filename, pid_t *mypid) |
piped_log * | ap_open_piped_log (apr_pool_t *p, const char *program) |
piped_log * | ap_open_piped_log_ex (apr_pool_t *p, const char *program, apr_cmdtype_e cmdtype) |
void | ap_close_piped_log (piped_log *pl) |
apr_file_t * | ap_piped_log_read_fd (piped_log *pl) |
apr_file_t * | ap_piped_log_write_fd (piped_log *pl) |
Variables | |
AP_DECLARE_DATA int | ap_default_loglevel |
#define AP_LOG_DATA_DEFAULT 0 |
Processing flags for ap_log_data() et al
AP_LOG_DATA_DEFAULT - default formatting, with printable chars and hex AP_LOG_DATA_SHOW_OFFSET - prefix each line with hex offset from the start of the buffer
#define AP_LOG_DATA_SHOW_OFFSET 1 |
#define APLOG_ALERT LOG_ALERT /* action must be taken immediately */ |
#define APLOG_C_IS_LEVEL | ( | c, | |
level | |||
) | APLOG_C_MODULE_IS_LEVEL(c,APLOG_MODULE_INDEX,level) |
#define APLOG_C_MODULE_IS_LEVEL | ( | c, | |
module_index, | |||
level | |||
) |
#define APLOG_CRIT LOG_CRIT /* critical conditions */ |
#define APLOG_CS_IS_LEVEL | ( | c, | |
s, | |||
level | |||
) | APLOG_CS_MODULE_IS_LEVEL(c,s,APLOG_MODULE_INDEX,level) |
#define APLOG_CS_MODULE_IS_LEVEL | ( | c, | |
s, | |||
module_index, | |||
level | |||
) |
#define APLOG_DEBUG LOG_DEBUG /* debug-level messages */ |
#define APLOG_EMERG LOG_EMERG /* system is unusable */ |
#define APLOG_ERR LOG_ERR /* error conditions */ |
#define APLOG_INFO LOG_INFO /* informational */ |
#define APLOG_IS_LEVEL | ( | s, | |
level | |||
) | APLOG_MODULE_IS_LEVEL(s,APLOG_MODULE_INDEX,level) |
#define APLOG_LEVELMASK 15 /* mask off the level value */ |
#define APLOG_MARK __FILE__,__LINE__,APLOG_MODULE_INDEX |
APLOG_MARK is a convenience macro for use as the first three parameters in ap_log_error() and related functions, i.e. file, line, and module_index.
The module_index parameter was introduced in version 2.3.6. Before that version, APLOG_MARK only replaced the file and line parameters. This means that APLOG_MARK can be used with ap_log_*error in all versions of Apache httpd.
#define APLOG_MAX_LOGLEVEL |
APLOG_MAX_LOGLEVEL can be defined to remove logging above some specified level at compile time.
This requires a C99 compiler.
#define APLOG_MODULE_INDEX (aplog_module_index ? *aplog_module_index : APLOG_NO_MODULE) |
APLOG_MODULE_INDEX contains the module_index of the current module if it has been set via the APLOG_USE_MODULE or AP_DECLARE_MODULE macro. Otherwise it contains APLOG_NO_MODULE (for example in unmodified httpd 2.2 modules).
If APLOG_MARK is used in ap_log_error() and related functions, APLOG_MODULE_INDEX will be passed as module_index. In cases where APLOG_MARK cannot be used, APLOG_MODULE_INDEX should normally be passed as module_index.
#define APLOG_MODULE_IS_LEVEL | ( | s, | |
module_index, | |||
level | |||
) |
#define APLOG_NO_MODULE -1 |
APLOG_NO_MODULE may be passed as module_index to ap_log_error() and related functions if the module causing the log message is not known. Normally this should not be used directly. Use APLOG_MARK or APLOG_MODULE_INDEX instead.
#define APLOG_NOERRNO (APLOG_LEVELMASK + 1) |
#define APLOG_NOTICE LOG_NOTICE /* normal but significant condition */ |
#define APLOG_R_IS_LEVEL | ( | r, | |
level | |||
) | APLOG_R_MODULE_IS_LEVEL(r,APLOG_MODULE_INDEX,level) |
#define APLOG_R_MODULE_IS_LEVEL | ( | r, | |
module_index, | |||
level | |||
) |
#define APLOG_STARTUP ((APLOG_LEVELMASK + 1) * 4) |
#define APLOG_TOCLIENT ((APLOG_LEVELMASK + 1) * 2) |
Use APLOG_TOCLIENT on ap_log_rerror() to give content handlers the option of including the error text in the ErrorDocument sent back to the client. Setting APLOG_TOCLIENT will cause the error text to be saved in the request_rec->notes table, keyed to the string "error-notes", if and only if:
#define APLOG_TRACE1 (LOG_DEBUG + 1) /* trace-level 1 messages */ |
#define APLOG_TRACE2 (LOG_DEBUG + 2) /* trace-level 2 messages */ |
#define APLOG_TRACE3 (LOG_DEBUG + 3) /* trace-level 3 messages */ |
#define APLOG_TRACE4 (LOG_DEBUG + 4) /* trace-level 4 messages */ |
#define APLOG_TRACE5 (LOG_DEBUG + 5) /* trace-level 5 messages */ |
#define APLOG_TRACE6 (LOG_DEBUG + 6) /* trace-level 6 messages */ |
#define APLOG_TRACE7 (LOG_DEBUG + 7) /* trace-level 7 messages */ |
#define APLOG_TRACE8 (LOG_DEBUG + 8) /* trace-level 8 messages */ |
#define APLOG_WARNING LOG_WARNING /* warning conditions */ |
#define APLOGcdebug | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_DEBUG) |
#define APLOGcinfo | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_INFO) |
#define APLOGctrace1 | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_TRACE1) |
#define APLOGctrace2 | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_TRACE2) |
#define APLOGctrace3 | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_TRACE3) |
#define APLOGctrace4 | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_TRACE4) |
#define APLOGctrace5 | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_TRACE5) |
#define APLOGctrace6 | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_TRACE6) |
#define APLOGctrace7 | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_TRACE7) |
#define APLOGctrace8 | ( | c | ) | APLOG_C_IS_LEVEL(c,APLOG_TRACE8) |
#define APLOGdebug | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_DEBUG) |
#define APLOGinfo | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_INFO) |
#define APLOGNO | ( | n | ) | "AH" #n ": " |
APLOGNO() should be used at the start of the format string passed to ap_log_error() and friends. The argument must be a 5 digit decimal number. It creates a tag of the form "AH02182: " See docs/log-message-tags/README for details.
#define APLOGrdebug | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_DEBUG) |
#define APLOGrinfo | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_INFO) |
#define APLOGrtrace1 | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_TRACE1) |
#define APLOGrtrace2 | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_TRACE2) |
#define APLOGrtrace3 | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_TRACE3) |
#define APLOGrtrace4 | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_TRACE4) |
#define APLOGrtrace5 | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_TRACE5) |
#define APLOGrtrace6 | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_TRACE6) |
#define APLOGrtrace7 | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_TRACE7) |
#define APLOGrtrace8 | ( | r | ) | APLOG_R_IS_LEVEL(r,APLOG_TRACE8) |
#define APLOGtrace1 | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_TRACE1) |
#define APLOGtrace2 | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_TRACE2) |
#define APLOGtrace3 | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_TRACE3) |
#define APLOGtrace4 | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_TRACE4) |
#define APLOGtrace5 | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_TRACE5) |
#define APLOGtrace6 | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_TRACE6) |
#define APLOGtrace7 | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_TRACE7) |
#define APLOGtrace8 | ( | s | ) | APLOG_IS_LEVEL(s,APLOG_TRACE8) |
#define DEFAULT_LOGLEVEL APLOG_WARNING |
#define LOG_PRIMASK 7 |
void ap_close_piped_log | ( | piped_log * | pl | ) |
Close the piped log and kill the logging process
pl | The piped log structure |
void ap_error_log2stderr | ( | server_rec * | s | ) |
Convert stderr to the error log
s | The current server |
void ap_log_cdata | ( | const char * | file, |
int | line, | ||
int | module_index, | ||
int | level, | ||
const conn_rec * | c, | ||
const char * | label, | ||
const void * | data, | ||
apr_size_t | len, | ||
unsigned int | flags | ||
) |
ap_log_cdata() - log buffers which are related to a particular connection.
file | The file in which this function is called |
line | The line number on which this function is called |
module_index | The module_index of the module logging this buffer |
level | The log level |
c | The connection which we are logging for |
label | A label for the buffer, to be logged preceding the buffer |
data | The buffer to be logged |
len | The length of the buffer |
flags | Special processing flags like AP_LOG_DATA_SHOW_OFFSET |
void ap_log_cerror | ( | const char * | file, |
int | line, | ||
int | module_index, | ||
int | level, | ||
apr_status_t | status, | ||
const conn_rec * | c, | ||
const char * | fmt, | ||
... | |||
) |
ap_log_cerror() - log messages which are related to a particular connection. This uses a printf-like format to log messages to the error_log.
file | The file in which this function is called |
line | The line number on which this function is called |
level | The level of this error message |
module_index | The module_index of the module generating this message |
status | The status code from the previous command |
c | The connection which we are logging for |
fmt | The format string |
... | The arguments to use to fill out fmt. |
void ap_log_command_line | ( | apr_pool_t * | p, |
server_rec * | s | ||
) |
Log the command line used to start the server.
p | The pool to use for logging |
s | The server_rec whose process's command line we want to log. The command line is logged to that server's error log. |
void ap_log_csdata | ( | const char * | file, |
int | line, | ||
int | module_index, | ||
int | level, | ||
const conn_rec * | c, | ||
const server_rec * | s, | ||
const char * | label, | ||
const void * | data, | ||
apr_size_t | len, | ||
unsigned int | flags | ||
) |
ap_log_csdata() - log buffers which are related to a particular connection and to a vhost other than c->base_server.
file | The file in which this function is called |
line | The line number on which this function is called |
module_index | The module_index of the module logging this buffer |
level | The log level |
c | The connection which we are logging for |
s | The server which we are logging for |
label | A label for the buffer, to be logged preceding the buffer |
data | The buffer to be logged |
len | The length of the buffer |
flags | Special processing flags like AP_LOG_DATA_SHOW_OFFSET |
void ap_log_cserror | ( | const char * | file, |
int | line, | ||
int | module_index, | ||
int | level, | ||
apr_status_t | status, | ||
const conn_rec * | c, | ||
const server_rec * | s, | ||
const char * | fmt, | ||
... | |||
) |
ap_log_cserror() - log messages which are related to a particular connection and to a vhost other than c->base_server. This uses a printf-like format to log messages to the error_log.
file | The file in which this function is called |
line | The line number on which this function is called |
level | The level of this error message |
module_index | The module_index of the module generating this message |
status | The status code from the previous command |
c | The connection which we are logging for |
s | The server which we are logging for |
fmt | The format string |
... | The arguments to use to fill out fmt. |
void ap_log_data | ( | const char * | file, |
int | line, | ||
int | module_index, | ||
int | level, | ||
const server_rec * | s, | ||
const char * | label, | ||
const void * | data, | ||
apr_size_t | len, | ||
unsigned int | flags | ||
) |
ap_log_data() - log buffers which are not related to a particular request or connection.
file | The file in which this function is called |
line | The line number on which this function is called |
module_index | The module_index of the module logging this buffer |
level | The log level |
s | The server on which we are logging |
label | A label for the buffer, to be logged preceding the buffer |
data | The buffer to be logged |
len | The length of the buffer |
flags | Special processing flags like AP_LOG_DATA_SHOW_OFFSET |
void ap_log_error | ( | const char * | file, |
int | line, | ||
int | module_index, | ||
int | level, | ||
apr_status_t | status, | ||
const server_rec * | s, | ||
const char * | fmt, | ||
... | |||
) |
ap_log_error() - log messages which are not related to a particular request or connection. This uses a printf-like format to log messages to the error_log.
file | The file in which this function is called |
line | The line number on which this function is called |
module_index | The module_index of the module generating this message |
level | The level of this error message |
status | The status code from the previous command |
s | The server on which we are logging |
fmt | The format string |
... | The arguments to use to fill out fmt. |
void ap_log_mpm_common | ( | server_rec * | s | ) |
Log common (various) MPM shared data at startup.
s | The server_rec of the error log we want to log to. Misc commonly logged data is logged to that server's error log. |
void ap_log_perror | ( | const char * | file, |
int | line, | ||
int | module_index, | ||
int | level, | ||
apr_status_t | status, | ||
apr_pool_t * | p, | ||
const char * | fmt, | ||
... | |||
) |
ap_log_perror() - log messages which are not related to a particular request, connection, or virtual server. This uses a printf-like format to log messages to the error_log.
file | The file in which this function is called |
line | The line number on which this function is called |
module_index | ignored dummy value for use by APLOG_MARK |
level | The level of this error message |
status | The status code from the previous command |
p | The pool which we are logging for |
fmt | The format string |
... | The arguments to use to fill out fmt. |
void ap_log_pid | ( | apr_pool_t * | p, |
const char * | fname | ||
) |
Log the current pid of the parent process
p | The pool to use for processing |
fname | The name of the file to log to. If the filename is not absolute then it is assumed to be relative to DefaultRuntimeDir. |
void ap_log_rdata | ( | const char * | file, |
int | line, | ||
int | module_index, | ||
int | level, | ||
const request_rec * | r, | ||
const char * | label, | ||
const void * | data, | ||
apr_size_t | len, | ||
unsigned int | flags | ||
) |
ap_log_rdata() - log buffers which are related to a particular request.
file | The file in which this function is called |
line | The line number on which this function is called |
module_index | The module_index of the module logging this buffer |
level | The log level |
r | The request which we are logging for |
label | A label for the buffer, to be logged preceding the buffer |
data | The buffer to be logged |
len | The length of the buffer |
flags | Special processing flags like AP_LOG_DATA_SHOW_OFFSET |
void ap_log_rerror | ( | const char * | file, |
int | line, | ||
int | module_index, | ||
int | level, | ||
apr_status_t | status, | ||
const request_rec * | r, | ||
const char * | fmt, | ||
... | |||
) |
ap_log_rerror() - log messages which are related to a particular request. This uses a printf-like format to log messages to the error_log.
file | The file in which this function is called |
line | The line number on which this function is called |
module_index | The module_index of the module generating this message |
level | The level of this error message |
status | The status code from the previous command |
r | The request which we are logging for |
fmt | The format string |
... | The arguments to use to fill out fmt. |
void ap_logs_child_init | ( | apr_pool_t * | p, |
server_rec * | s | ||
) |
Perform special processing for piped loggers in MPM child processes.
p | Not used |
s | Not used |
int ap_open_logs | ( | apr_pool_t * | pconf, |
apr_pool_t * | plog, | ||
apr_pool_t * | ptemp, | ||
server_rec * | s_main | ||
) |
Open the error log and replace stderr with it.
pconf | Not used |
plog | The pool to allocate the logs from |
ptemp | Pool used for temporary allocations |
s_main | The main server |
piped_log* ap_open_piped_log | ( | apr_pool_t * | p, |
const char * | program | ||
) |
Open the piped log process
p | The pool to allocate out of |
program | The program to run in the logging process |
APR_PROGRAM_ENV
, piped_log* ap_open_piped_log_ex | ( | apr_pool_t * | p, |
const char * | program, | ||
apr_cmdtype_e | cmdtype | ||
) |
Open the piped log process specifying the execution choice for program
p | The pool to allocate out of |
program | The program to run in the logging process |
cmdtype | How to invoke program, e.g. APR_PROGRAM, APR_SHELLCMD_ENV, etc |
void ap_open_stderr_log | ( | apr_pool_t * | p | ) |
Set up for logging to stderr.
p | The pool to allocate out of |
apr_file_t* ap_piped_log_read_fd | ( | piped_log * | pl | ) |
A function to return the read side of the piped log pipe
pl | The piped log structure |
apr_file_t* ap_piped_log_write_fd | ( | piped_log * | pl | ) |
A function to return the write side of the piped log pipe
pl | The piped log structure |
apr_status_t ap_read_pid | ( | apr_pool_t * | p, |
const char * | filename, | ||
pid_t * | mypid | ||
) |
Retrieve the pid from a pidfile.
p | The pool to use for processing |
filename | The name of the file containing the pid. If the filename is not absolute then it is assumed to be relative to DefaultRuntimeDir. |
mypid | Pointer to pid_t (valid only if return APR_SUCCESS) |
void ap_remove_pid | ( | apr_pool_t * | p, |
const char * | fname | ||
) |
Remove the pidfile.
p | The pool to use for processing |
fname | The name of the pid file to remove. If the filename is not absolute then it is assumed to be relative to DefaultRuntimeDir. |
apr_status_t ap_replace_stderr_log | ( | apr_pool_t * | p, |
const char * | file | ||
) |
Replace logging to stderr with logging to the given file.
p | The pool to allocate out of |
file | Name of the file to log stderr output |
|
extern |