Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables

Classes

struct  ap_LINK_generate_log_id_t
 

Macros

#define APLOG_EMERG   0 /* system is unusable */
 
#define APLOG_ALERT   1 /* action must be taken immediately */
 
#define APLOG_CRIT   2 /* critical conditions */
 
#define APLOG_ERR   3 /* error conditions */
 
#define APLOG_WARNING   4 /* warning conditions */
 
#define APLOG_NOTICE   5 /* normal but significant condition */
 
#define APLOG_INFO   6 /* informational */
 
#define APLOG_DEBUG   7 /* debug-level messages */
 
#define APLOG_TRACE1   8 /* trace-level 1 messages */
 
#define APLOG_TRACE2   9 /* trace-level 2 messages */
 
#define APLOG_TRACE3   10 /* trace-level 3 messages */
 
#define APLOG_TRACE4   11 /* trace-level 4 messages */
 
#define APLOG_TRACE5   12 /* trace-level 5 messages */
 
#define APLOG_TRACE6   13 /* trace-level 6 messages */
 
#define APLOG_TRACE7   14 /* trace-level 7 messages */
 
#define APLOG_TRACE8   15 /* trace-level 8 messages */
 
#define APLOG_LEVELMASK   15 /* mask off the level value */
 
#define APLOG_NOERRNO   (APLOG_LEVELMASK + 1)
 
#define APLOG_TOCLIENT   ((APLOG_LEVELMASK + 1) * 2)
 
#define APLOG_STARTUP   ((APLOG_LEVELMASK + 1) * 4)
 
#define DEFAULT_LOGLEVEL   APLOG_WARNING
 
#define APLOGNO(n)   "AH" #n ": "
 
#define APLOG_NO_MODULE   -1
 
#define APLOG_MODULE_INDEX    (aplog_module_index ? *aplog_module_index : APLOG_NO_MODULE)
 
#define APLOG_MODULE_IS_LEVEL(s, module_index, level)
 
#define APLOG_C_MODULE_IS_LEVEL(c, module_index, level)
 
#define APLOG_CS_MODULE_IS_LEVEL(c, s, module_index, level)
 
#define APLOG_R_MODULE_IS_LEVEL(r, module_index, level)
 
#define APLOG_IS_LEVEL(s, level)    APLOG_MODULE_IS_LEVEL(s,APLOG_MODULE_INDEX,level)
 
#define APLOG_C_IS_LEVEL(c, level)    APLOG_C_MODULE_IS_LEVEL(c,APLOG_MODULE_INDEX,level)
 
#define APLOG_CS_IS_LEVEL(c, s, level)    APLOG_CS_MODULE_IS_LEVEL(c,s,APLOG_MODULE_INDEX,level)
 
#define APLOG_R_IS_LEVEL(r, level)    APLOG_R_MODULE_IS_LEVEL(r,APLOG_MODULE_INDEX,level)
 
#define APLOGinfo(s)   APLOG_IS_LEVEL(s,APLOG_INFO)
 
#define APLOGdebug(s)   APLOG_IS_LEVEL(s,APLOG_DEBUG)
 
#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 APLOGrinfo(r)   APLOG_R_IS_LEVEL(r,APLOG_INFO)
 
#define APLOGrdebug(r)   APLOG_R_IS_LEVEL(r,APLOG_DEBUG)
 
#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 APLOGcinfo(c)   APLOG_C_IS_LEVEL(c,APLOG_INFO)
 
#define APLOGcdebug(c)   APLOG_C_IS_LEVEL(c,APLOG_DEBUG)
 
#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 APLOG_MARK   __FILE__,__LINE__,APLOG_MODULE_INDEX
 
#define ap_log_error   ap_log_error_
 
#define ap_log_perror   ap_log_perror_
 
#define ap_log_rerror   ap_log_rerror_
 
#define ap_log_cerror   ap_log_cerror_
 
#define ap_log_cserror   ap_log_cserror_
 
#define AP_LOG_DATA_DEFAULT   0
 
#define AP_LOG_DATA_SHOW_OFFSET   1
 
#define ap_log_data   ap_log_data_
 
#define ap_log_rdata   ap_log_rdata_
 
#define ap_log_cdata   ap_log_cdata_
 
#define ap_log_cdata   ap_log_cdata_
 

Typedefs

typedef struct piped_log piped_log
 
typedef struct ap_LINK_generate_log_id_t ap_LINK_generate_log_id_t
 

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,...) __attribute__((format(printf
 
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,...) __attribute__((format(printf
 
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,...) __attribute__((format(printf
 
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,...) __attribute__((format(printf
 
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,...) __attribute__((format(printf
 
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_logap_open_piped_log (apr_pool_t *p, const char *program)
 
piped_logap_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_tap_piped_log_read_fd (piped_log *pl)
 
apr_file_tap_piped_log_write_fd (piped_log *pl)
 
void ap_hook_generate_log_id (ap_HOOK_generate_log_id_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
int ap_run_generate_log_id (const conn_rec *c, const request_rec *r, const char **id)
 
apr_array_header_tap_hook_get_generate_log_id (void)
 

Variables

static int *const aplog_module_index
 
int ap_default_loglevel
 

Detailed Description

Macro Definition Documentation

◆ ap_log_cdata [1/2]

#define ap_log_cdata   ap_log_cdata_

ap_log_cdata() - log buffers which are related to a particular connection.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
module_indexThe module_index of the module logging this buffer
levelThe log level
cThe connection which we are logging for
labelA label for the buffer, to be logged preceding the buffer
dataThe buffer to be logged
lenThe length of the buffer
flagsSpecial processing flags like AP_LOG_DATA_SHOW_OFFSET
Note
ap_log_cdata is implemented as a macro
Use APLOG_MARK to fill out file, line, and module_index
If a request_rec is available, use that with ap_log_rerror() in preference to calling this function. Otherwise, if a conn_rec is available, use that with ap_log_cerror() in preference to calling this function.

ap_log_csdata() - log buffers which are related to a particular connection and to a vhost other than c->base_server.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
module_indexThe module_index of the module logging this buffer
levelThe log level
cThe connection which we are logging for
sThe server which we are logging for
labelA label for the buffer, to be logged preceding the buffer
dataThe buffer to be logged
lenThe length of the buffer
flagsSpecial processing flags like AP_LOG_DATA_SHOW_OFFSET
Note
ap_log_csdata is implemented as a macro
Use APLOG_MARK to fill out file, line, and module_index
If a request_rec is available, use that with ap_log_rerror() in preference to calling this function. Otherwise, if a conn_rec is available, use that with ap_log_cerror() in preference to calling this function.

Definition at line 680 of file http_log.h.

◆ ap_log_cdata [2/2]

#define ap_log_cdata   ap_log_cdata_

ap_log_cdata() - log buffers which are related to a particular connection.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
module_indexThe module_index of the module logging this buffer
levelThe log level
cThe connection which we are logging for
labelA label for the buffer, to be logged preceding the buffer
dataThe buffer to be logged
lenThe length of the buffer
flagsSpecial processing flags like AP_LOG_DATA_SHOW_OFFSET
Note
ap_log_cdata is implemented as a macro
Use APLOG_MARK to fill out file, line, and module_index
If a request_rec is available, use that with ap_log_rerror() in preference to calling this function. Otherwise, if a conn_rec is available, use that with ap_log_cerror() in preference to calling this function.

ap_log_csdata() - log buffers which are related to a particular connection and to a vhost other than c->base_server.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
module_indexThe module_index of the module logging this buffer
levelThe log level
cThe connection which we are logging for
sThe server which we are logging for
labelA label for the buffer, to be logged preceding the buffer
dataThe buffer to be logged
lenThe length of the buffer
flagsSpecial processing flags like AP_LOG_DATA_SHOW_OFFSET
Note
ap_log_csdata is implemented as a macro
Use APLOG_MARK to fill out file, line, and module_index
If a request_rec is available, use that with ap_log_rerror() in preference to calling this function. Otherwise, if a conn_rec is available, use that with ap_log_cerror() in preference to calling this function.

Definition at line 680 of file http_log.h.

◆ ap_log_cerror

#define ap_log_cerror   ap_log_cerror_

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.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
levelThe level of this error message
module_indexThe module_index of the module generating this message
statusThe status code from the previous command
cThe connection which we are logging for
fmtThe format string
...The arguments to use to fill out fmt.
Note
ap_log_cerror is implemented as a macro
Use APLOG_MARK to fill out file, line, and module_index
If a request_rec is available, use that with ap_log_rerror() in preference to calling this function.
Warning
It is VERY IMPORTANT that you not include any raw data from the network, such as the request-URI or request header fields, within the format string. Doing so makes the server vulnerable to a denial-of-service attack and other messy behavior. Instead, use a simple format string like "%s", followed by the string containing the untrusted data.

Definition at line 498 of file http_log.h.

◆ ap_log_cserror

#define ap_log_cserror   ap_log_cserror_

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.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
levelThe level of this error message
module_indexThe module_index of the module generating this message
statusThe status code from the previous command
cThe connection which we are logging for
sThe server which we are logging for
fmtThe format string
...The arguments to use to fill out fmt.
Note
ap_log_cserror is implemented as a macro
Use APLOG_MARK to fill out file, line, and module_index
If a request_rec is available, use that with ap_log_rerror() in preference to calling this function. This function is mainly useful for modules like mod_ssl to use before the request_rec is created.
Warning
It is VERY IMPORTANT that you not include any raw data from the network, such as the request-URI or request header fields, within the format string. Doing so makes the server vulnerable to a denial-of-service attack and other messy behavior. Instead, use a simple format string like "%s", followed by the string containing the untrusted data.

Definition at line 546 of file http_log.h.

◆ ap_log_data

#define ap_log_data   ap_log_data_

ap_log_data() - log buffers which are not related to a particular request or connection.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
module_indexThe module_index of the module logging this buffer
levelThe log level
sThe server on which we are logging
labelA label for the buffer, to be logged preceding the buffer
dataThe buffer to be logged
lenThe length of the buffer
flagsSpecial processing flags like AP_LOG_DATA_SHOW_OFFSET
Note
ap_log_data is implemented as a macro.
Use APLOG_MARK to fill out file, line, and module_index
If a request_rec is available, use that with ap_log_rdata() in preference to calling this function. Otherwise, if a conn_rec is available, use that with ap_log_cdata() in preference to calling this function.

Definition at line 604 of file http_log.h.

◆ AP_LOG_DATA_DEFAULT

#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

Definition at line 568 of file http_log.h.

◆ AP_LOG_DATA_SHOW_OFFSET

#define AP_LOG_DATA_SHOW_OFFSET   1

Definition at line 569 of file http_log.h.

◆ ap_log_error

#define ap_log_error   ap_log_error_

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.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
module_indexThe module_index of the module generating this message
levelThe level of this error message
statusThe status code from the previous command
sThe server on which we are logging
fmtThe format string
...The arguments to use to fill out fmt.
Note
ap_log_error is implemented as a macro
Use APLOG_MARK to fill out file and line
If a request_rec is available, use that with ap_log_rerror() in preference to calling this function. Otherwise, if a conn_rec is available, use that with ap_log_cerror() in preference to calling this function.
Warning
It is VERY IMPORTANT that you not include any raw data from the network, such as the request-URI or request header fields, within the format string. Doing so makes the server vulnerable to a denial-of-service attack and other messy behavior. Instead, use a simple format string like "%s", followed by the string containing the untrusted data.

Definition at line 370 of file http_log.h.

◆ ap_log_perror

#define ap_log_perror   ap_log_perror_

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.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
module_indexignored dummy value for use by APLOG_MARK
levelThe level of this error message
statusThe status code from the previous command
pThe pool which we are logging for
fmtThe format string
...The arguments to use to fill out fmt.
Note
ap_log_perror is implemented as a macro
Use APLOG_MARK to fill out file, line, and module_index
Warning
It is VERY IMPORTANT that you not include any raw data from the network, such as the request-URI or request header fields, within the format string. Doing so makes the server vulnerable to a denial-of-service attack and other messy behavior. Instead, use a simple format string like "%s", followed by the string containing the untrusted data.

Definition at line 412 of file http_log.h.

◆ ap_log_rdata

#define ap_log_rdata   ap_log_rdata_

ap_log_rdata() - log buffers which are related to a particular request.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
module_indexThe module_index of the module logging this buffer
levelThe log level
rThe request which we are logging for
labelA label for the buffer, to be logged preceding the buffer
dataThe buffer to be logged
lenThe length of the buffer
flagsSpecial processing flags like AP_LOG_DATA_SHOW_OFFSET
Note
ap_log_rdata is implemented as a macro.
Use APLOG_MARK to fill out file, line, and module_index
If a request_rec is available, use that with ap_log_rerror() in preference to calling this function. Otherwise, if a conn_rec is available, use that with ap_log_cerror() in preference to calling this function.

Definition at line 642 of file http_log.h.

◆ ap_log_rerror

#define ap_log_rerror   ap_log_rerror_

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.

Parameters
fileThe file in which this function is called
lineThe line number on which this function is called
module_indexThe module_index of the module generating this message
levelThe level of this error message
statusThe status code from the previous command
rThe request which we are logging for
fmtThe format string
...The arguments to use to fill out fmt.
Note
ap_log_rerror is implemented as a macro
Use APLOG_MARK to fill out file, line, and module_index
Warning
It is VERY IMPORTANT that you not include any raw data from the network, such as the request-URI or request header fields, within the format string. Doing so makes the server vulnerable to a denial-of-service attack and other messy behavior. Instead, use a simple format string like "%s", followed by the string containing the untrusted data.

Definition at line 454 of file http_log.h.

◆ APLOG_ALERT

#define APLOG_ALERT   1 /* action must be taken immediately */

Definition at line 65 of file http_log.h.

◆ APLOG_C_IS_LEVEL

#define APLOG_C_IS_LEVEL (   c,
  level 
)     APLOG_C_MODULE_IS_LEVEL(c,APLOG_MODULE_INDEX,level)

Definition at line 225 of file http_log.h.

◆ APLOG_C_MODULE_IS_LEVEL

#define APLOG_C_MODULE_IS_LEVEL (   c,
  module_index,
  level 
)
Value:
( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) || \
(ap_get_conn_module_loglevel(c, module_index) \
>= ((level)&APLOG_LEVELMASK) ) )
#define ap_get_conn_module_loglevel(c, i)
#define APLOG_NOTICE
Definition http_log.h:69
#define APLOG_LEVELMASK
Definition http_log.h:81
apr_vformatter_buff_t * c
Definition apr_lib.h:175

Definition at line 187 of file http_log.h.

◆ APLOG_CRIT

#define APLOG_CRIT   2 /* critical conditions */

Definition at line 66 of file http_log.h.

◆ APLOG_CS_IS_LEVEL

#define APLOG_CS_IS_LEVEL (   c,
  s,
  level 
)     APLOG_CS_MODULE_IS_LEVEL(c,s,APLOG_MODULE_INDEX,level)

Definition at line 227 of file http_log.h.

◆ APLOG_CS_MODULE_IS_LEVEL

#define APLOG_CS_MODULE_IS_LEVEL (   c,
  s,
  module_index,
  level 
)
Value:
( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) || \
>= ((level)&APLOG_LEVELMASK) ) )
#define ap_get_conn_server_module_loglevel(c, s, i)
const char * s
Definition apr_strings.h:95

Definition at line 191 of file http_log.h.

◆ APLOG_DEBUG

#define APLOG_DEBUG   7 /* debug-level messages */

Definition at line 71 of file http_log.h.

◆ APLOG_EMERG

#define APLOG_EMERG   0 /* system is unusable */

Definition at line 64 of file http_log.h.

◆ APLOG_ERR

#define APLOG_ERR   3 /* error conditions */

Definition at line 67 of file http_log.h.

◆ APLOG_INFO

#define APLOG_INFO   6 /* informational */

Definition at line 70 of file http_log.h.

◆ APLOG_IS_LEVEL

#define APLOG_IS_LEVEL (   s,
  level 
)     APLOG_MODULE_IS_LEVEL(s,APLOG_MODULE_INDEX,level)

Definition at line 223 of file http_log.h.

◆ APLOG_LEVELMASK

#define APLOG_LEVELMASK   15 /* mask off the level value */

Definition at line 81 of file http_log.h.

◆ APLOG_MARK

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.

See also
APLOG_MODULE_INDEX
ap_log_error
ap_log_cerror
ap_log_rerror
ap_log_cserror

Definition at line 283 of file http_log.h.

◆ APLOG_MODULE_INDEX

#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.

See also
APLOG_MARK
ap_log_error

Definition at line 168 of file http_log.h.

◆ APLOG_MODULE_IS_LEVEL

#define APLOG_MODULE_IS_LEVEL (   s,
  module_index,
  level 
)
Value:
( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) || \
(s == NULL) || \
(ap_get_server_module_loglevel(s, module_index) \
>= ((level)&APLOG_LEVELMASK) ) )
#define ap_get_server_module_loglevel(s, i)
return NULL
Definition mod_so.c:359

APLOG_MAX_LOGLEVEL can be defined to remove logging above some specified level at compile time.

This requires a C99 compiler.

Definition at line 182 of file http_log.h.

◆ APLOG_NO_MODULE

#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.

See also
APLOG_MARK
APLOG_MODULE_INDEX
ap_log_error

Definition at line 129 of file http_log.h.

◆ APLOG_NOERRNO

#define APLOG_NOERRNO   (APLOG_LEVELMASK + 1)

Definition at line 88 of file http_log.h.

◆ APLOG_NOTICE

#define APLOG_NOTICE   5 /* normal but significant condition */

Definition at line 69 of file http_log.h.

◆ APLOG_R_IS_LEVEL

#define APLOG_R_IS_LEVEL (   r,
  level 
)     APLOG_R_MODULE_IS_LEVEL(r,APLOG_MODULE_INDEX,level)

Definition at line 229 of file http_log.h.

◆ APLOG_R_MODULE_IS_LEVEL

#define APLOG_R_MODULE_IS_LEVEL (   r,
  module_index,
  level 
)
Value:
( (((level)&APLOG_LEVELMASK) <= APLOG_NOTICE) || \
>= ((level)&APLOG_LEVELMASK) ) )
#define ap_get_request_module_loglevel(r, i)
request_rec * r

Definition at line 195 of file http_log.h.

◆ APLOG_STARTUP

#define APLOG_STARTUP   ((APLOG_LEVELMASK + 1) * 4)

Definition at line 105 of file http_log.h.

◆ APLOG_TOCLIENT

#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:

  • the severity level of the message is APLOG_WARNING or greater
  • there are no other "error-notes" set in request_rec->notes Once error-notes is set, it is up to the content handler to determine whether this text should be sent back to the client. Note: Client generated text streams sent back to the client MUST be escaped to prevent CSS attacks.

Definition at line 102 of file http_log.h.

◆ APLOG_TRACE1

#define APLOG_TRACE1   8 /* trace-level 1 messages */

Definition at line 72 of file http_log.h.

◆ APLOG_TRACE2

#define APLOG_TRACE2   9 /* trace-level 2 messages */

Definition at line 73 of file http_log.h.

◆ APLOG_TRACE3

#define APLOG_TRACE3   10 /* trace-level 3 messages */

Definition at line 74 of file http_log.h.

◆ APLOG_TRACE4

#define APLOG_TRACE4   11 /* trace-level 4 messages */

Definition at line 75 of file http_log.h.

◆ APLOG_TRACE5

#define APLOG_TRACE5   12 /* trace-level 5 messages */

Definition at line 76 of file http_log.h.

◆ APLOG_TRACE6

#define APLOG_TRACE6   13 /* trace-level 6 messages */

Definition at line 77 of file http_log.h.

◆ APLOG_TRACE7

#define APLOG_TRACE7   14 /* trace-level 7 messages */

Definition at line 78 of file http_log.h.

◆ APLOG_TRACE8

#define APLOG_TRACE8   15 /* trace-level 8 messages */

Definition at line 79 of file http_log.h.

◆ APLOG_WARNING

#define APLOG_WARNING   4 /* warning conditions */

Definition at line 68 of file http_log.h.

◆ APLOGcdebug

#define APLOGcdebug (   c)    APLOG_C_IS_LEVEL(c,APLOG_DEBUG)

Definition at line 256 of file http_log.h.

◆ APLOGcinfo

#define APLOGcinfo (   c)    APLOG_C_IS_LEVEL(c,APLOG_INFO)

Definition at line 255 of file http_log.h.

◆ APLOGctrace1

#define APLOGctrace1 (   c)    APLOG_C_IS_LEVEL(c,APLOG_TRACE1)

Definition at line 257 of file http_log.h.

◆ APLOGctrace2

#define APLOGctrace2 (   c)    APLOG_C_IS_LEVEL(c,APLOG_TRACE2)

Definition at line 258 of file http_log.h.

◆ APLOGctrace3

#define APLOGctrace3 (   c)    APLOG_C_IS_LEVEL(c,APLOG_TRACE3)

Definition at line 259 of file http_log.h.

◆ APLOGctrace4

#define APLOGctrace4 (   c)    APLOG_C_IS_LEVEL(c,APLOG_TRACE4)

Definition at line 260 of file http_log.h.

◆ APLOGctrace5

#define APLOGctrace5 (   c)    APLOG_C_IS_LEVEL(c,APLOG_TRACE5)

Definition at line 261 of file http_log.h.

◆ APLOGctrace6

#define APLOGctrace6 (   c)    APLOG_C_IS_LEVEL(c,APLOG_TRACE6)

Definition at line 262 of file http_log.h.

◆ APLOGctrace7

#define APLOGctrace7 (   c)    APLOG_C_IS_LEVEL(c,APLOG_TRACE7)

Definition at line 263 of file http_log.h.

◆ APLOGctrace8

#define APLOGctrace8 (   c)    APLOG_C_IS_LEVEL(c,APLOG_TRACE8)

Definition at line 264 of file http_log.h.

◆ APLOGdebug

#define APLOGdebug (   s)    APLOG_IS_LEVEL(s,APLOG_DEBUG)

Definition at line 234 of file http_log.h.

◆ APLOGinfo

#define APLOGinfo (   s)    APLOG_IS_LEVEL(s,APLOG_INFO)

Definition at line 233 of file http_log.h.

◆ APLOGNO

#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.

Definition at line 117 of file http_log.h.

◆ APLOGrdebug

#define APLOGrdebug (   r)    APLOG_R_IS_LEVEL(r,APLOG_DEBUG)

Definition at line 245 of file http_log.h.

◆ APLOGrinfo

#define APLOGrinfo (   r)    APLOG_R_IS_LEVEL(r,APLOG_INFO)

Definition at line 244 of file http_log.h.

◆ APLOGrtrace1

#define APLOGrtrace1 (   r)    APLOG_R_IS_LEVEL(r,APLOG_TRACE1)

Definition at line 246 of file http_log.h.

◆ APLOGrtrace2

#define APLOGrtrace2 (   r)    APLOG_R_IS_LEVEL(r,APLOG_TRACE2)

Definition at line 247 of file http_log.h.

◆ APLOGrtrace3

#define APLOGrtrace3 (   r)    APLOG_R_IS_LEVEL(r,APLOG_TRACE3)

Definition at line 248 of file http_log.h.

◆ APLOGrtrace4

#define APLOGrtrace4 (   r)    APLOG_R_IS_LEVEL(r,APLOG_TRACE4)

Definition at line 249 of file http_log.h.

◆ APLOGrtrace5

#define APLOGrtrace5 (   r)    APLOG_R_IS_LEVEL(r,APLOG_TRACE5)

Definition at line 250 of file http_log.h.

◆ APLOGrtrace6

#define APLOGrtrace6 (   r)    APLOG_R_IS_LEVEL(r,APLOG_TRACE6)

Definition at line 251 of file http_log.h.

◆ APLOGrtrace7

#define APLOGrtrace7 (   r)    APLOG_R_IS_LEVEL(r,APLOG_TRACE7)

Definition at line 252 of file http_log.h.

◆ APLOGrtrace8

#define APLOGrtrace8 (   r)    APLOG_R_IS_LEVEL(r,APLOG_TRACE8)

Definition at line 253 of file http_log.h.

◆ APLOGtrace1

#define APLOGtrace1 (   s)    APLOG_IS_LEVEL(s,APLOG_TRACE1)

Definition at line 235 of file http_log.h.

◆ APLOGtrace2

#define APLOGtrace2 (   s)    APLOG_IS_LEVEL(s,APLOG_TRACE2)

Definition at line 236 of file http_log.h.

◆ APLOGtrace3

#define APLOGtrace3 (   s)    APLOG_IS_LEVEL(s,APLOG_TRACE3)

Definition at line 237 of file http_log.h.

◆ APLOGtrace4

#define APLOGtrace4 (   s)    APLOG_IS_LEVEL(s,APLOG_TRACE4)

Definition at line 238 of file http_log.h.

◆ APLOGtrace5

#define APLOGtrace5 (   s)    APLOG_IS_LEVEL(s,APLOG_TRACE5)

Definition at line 239 of file http_log.h.

◆ APLOGtrace6

#define APLOGtrace6 (   s)    APLOG_IS_LEVEL(s,APLOG_TRACE6)

Definition at line 240 of file http_log.h.

◆ APLOGtrace7

#define APLOGtrace7 (   s)    APLOG_IS_LEVEL(s,APLOG_TRACE7)

Definition at line 241 of file http_log.h.

◆ APLOGtrace8

#define APLOGtrace8 (   s)    APLOG_IS_LEVEL(s,APLOG_TRACE8)

Definition at line 242 of file http_log.h.

◆ DEFAULT_LOGLEVEL

#define DEFAULT_LOGLEVEL   APLOG_WARNING

Definition at line 108 of file http_log.h.

Typedef Documentation

◆ ap_LINK_generate_log_id_t

◆ piped_log

See also
piped_log

Definition at line 776 of file http_log.h.

Function Documentation

◆ ap_close_piped_log()

void ap_close_piped_log ( piped_log pl)

Close the piped log and kill the logging process

Parameters
plThe piped log structure

Definition at line 1978 of file log.c.

◆ ap_error_log2stderr()

void ap_error_log2stderr ( server_rec s)

Convert stderr to the error log

Parameters
sThe current server

Definition at line 579 of file log.c.

◆ ap_hook_generate_log_id()

void ap_hook_generate_log_id ( ap_HOOK_generate_log_id_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 2009 of file log.c.

◆ ap_hook_get_generate_log_id()

apr_array_header_t * ap_hook_get_generate_log_id ( void  )

Definition at line 2009 of file log.c.

◆ ap_log_cdata_()

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 
)

Definition at line 1556 of file log.c.

◆ ap_log_cerror_()

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_command_line()

void ap_log_command_line ( apr_pool_t p,
server_rec s 
)

Log the command line used to start the server.

Parameters
pThe pool to use for logging
sThe server_rec whose process's command line we want to log. The command line is logged to that server's error log.

Definition at line 1575 of file log.c.

◆ ap_log_csdata_()

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 
)

Definition at line 1566 of file log.c.

◆ ap_log_cserror_()

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_data_()

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 
)

Definition at line 1536 of file log.c.

◆ ap_log_error_()

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_mpm_common()

void ap_log_mpm_common ( server_rec s)

Log common (various) MPM shared data at startup.

Parameters
sThe server_rec of the error log we want to log to. Misc commonly logged data is logged to that server's error log.

Definition at line 1603 of file log.c.

◆ ap_log_perror_()

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_pid()

void ap_log_pid ( apr_pool_t p,
const char fname 
)

Log the current pid of the parent process

Parameters
pThe pool to use for processing
fnameThe name of the file to log to. If the filename is not absolute then it is assumed to be relative to ServerRoot.

< Modification Time

< Open the file for writing

< Create the file if not there

< Open the file and truncate to 0 length

< Read by user

<

Deprecated:
See also
APR_FPROT_UREAD

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Read by group

<

Deprecated:
See also
APR_FPROT_GREAD

< Read by others

<

Deprecated:
See also
APR_FPROT_WREAD

Definition at line 1630 of file log.c.

◆ ap_log_rdata_()

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 
)

Definition at line 1546 of file log.c.

◆ ap_log_rerror_()

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_logs_child_init()

void ap_logs_child_init ( apr_pool_t p,
server_rec s 
)

Perform special processing for piped loggers in MPM child processes.

Parameters
pNot used
sNot used
Note
ap_logs_child_init is not for use by modules; it is an internal core function

Definition at line 233 of file log.c.

◆ ap_open_logs()

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.

Parameters
pconfNot used
plogThe pool to allocate the logs from
ptempPool used for temporary allocations
s_mainThe main server
Note
ap_open_logs isn't expected to be used by modules, it is an internal core function

< Module has handled this stage.

< Module has served the response completely * - it's safe to die() with no more output

< Module has handled this stage.

< Module has served the response completely * - it's safe to die() with no more output

< Module has handled this stage.

Definition at line 472 of file log.c.

◆ ap_open_piped_log()

piped_log * ap_open_piped_log ( apr_pool_t p,
const char program 
)

Open the piped log process

Parameters
pThe pool to allocate out of
programThe program to run in the logging process
Returns
The piped log structure
Note
The log program is invoked as APR_PROGRAM_ENV,
See also
ap_open_piped_log_ex to modify this behavior

Definition at line 1958 of file log.c.

◆ ap_open_piped_log_ex()

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

Parameters
pThe pool to allocate out of
programThe program to run in the logging process
cmdtypeHow to invoke program, e.g. APR_PROGRAM, APR_SHELLCMD_ENV, etc
Returns
The piped log structure

Definition at line 1931 of file log.c.

◆ ap_open_stderr_log()

void ap_open_stderr_log ( apr_pool_t p)

Set up for logging to stderr.

Parameters
pThe pool to allocate out of

Definition at line 243 of file log.c.

◆ ap_piped_log_read_fd()

apr_file_t * ap_piped_log_read_fd ( piped_log pl)

A function to return the read side of the piped log pipe

Parameters
plThe piped log structure
Returns
The native file descriptor

Definition at line 201 of file log.c.

◆ ap_piped_log_write_fd()

apr_file_t * ap_piped_log_write_fd ( piped_log pl)

A function to return the write side of the piped log pipe

Parameters
plThe piped log structure
Returns
The native file descriptor

Definition at line 206 of file log.c.

◆ ap_read_pid()

apr_status_t ap_read_pid ( apr_pool_t p,
const char filename,
pid_t mypid 
)

Retrieve the pid from a pidfile.

Parameters
pThe pool to use for processing
filenameThe name of the file containing the pid. If the filename is not absolute then it is assumed to be relative to ServerRoot.
mypidPointer to pid_t (valid only if return APR_SUCCESS)

< Open the file for reading

<

Deprecated:
See also
APR_FOPEN_READ

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

Definition at line 1697 of file log.c.

◆ ap_remove_pid()

void ap_remove_pid ( apr_pool_t p,
const char fname 
)

Remove the pidfile.

Parameters
pThe pool to use for processing
fnameThe name of the pid file to remove. If the filename is not absolute then it is assumed to be relative to ServerRoot.

Definition at line 1611 of file log.c.

◆ ap_replace_stderr_log()

apr_status_t ap_replace_stderr_log ( apr_pool_t p,
const char file 
)

Replace logging to stderr with logging to the given file.

Parameters
pThe pool to allocate out of
fileName of the file to log stderr output

< Append to the end of the file

<

Deprecated:
See also
APR_FOPEN_APPEND

< Open the file for writing

<

Deprecated:
See also
APR_FOPEN_WRITE

< Create the file if not there

<

Deprecated:
See also
APR_FOPEN_CREATE

< Platform dependent flag to enable * large file support, see WARNING below

<

Deprecated:
See also
APR_FOPEN_LARGEFILE

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

Definition at line 248 of file log.c.

◆ ap_run_generate_log_id()

int ap_run_generate_log_id ( const conn_rec c,
const request_rec r,
const char **  id 
)

< Module declines to handle

< Module declines to handle

Definition at line 2009 of file log.c.

Variable Documentation

◆ ap_default_loglevel

int ap_default_loglevel
extern

Definition at line 81 of file log.c.

◆ aplog_module_index

int* const aplog_module_index
static

Constant to store module_index for the current file. Objects with static storage duration are set to NULL if not initialized explicitly. This means that if aplog_module_index is not initialized using the APLOG_USE_MODULE or the AP_DECLARE_MODULE macro, we can safely fall back to use APLOG_NO_MODULE. This variable will usually be optimized away.

Definition at line 148 of file http_log.h.