| Source: | ./include/http_log.h |
|---|---|
The piped logging structure. Piped logs are used to move functionality out of the main server. For example, log rotation is done with piped logs.
apr_file_t *fds[2];
- The pipe between the server and the logging process
apr_pool_t *p;
- The pool to use for the piped log
apr_proc_t *pid;
- The pid of the logging process
char *program;
- The name of the program the logging process is running
(void);
- Set up for logging to stderr.
- Parameters
p The pool to allocate out of
(apr_status_t);
- Replace logging to stderr with logging to the given file.
- Parameters
p The pool to allocate out of file Name of the file to log stderr output
(void);
- Log the current pid of the parent process
- Parameters
p The pool to use for logging fname The name of the file to log to
(apr_status_t);
- Retrieve the pid from a pidfile.
- Parameters
p The pool to use for logging filename The name of the file containing the pid mypid Pointer to pid_t (valid only if return APR_SUCCESS)
void ap_logs_child_init(apr_pool_t *p, server_rec *s);
- Perform special processing for piped loggers in MPM child processes.
ap_logs_child_init is not for use by modules; it is an internal core function
- Parameters
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.
ap_open_logs isn't expected to be used by modules, it is an internal core function
- Parameters
pconf Not used plog The pool to allocate the logs from ptemp Pool used for temporary allocations s_main The main server
ap_piped_log_read_fd(pl);
- A macro to access the read side of the piped log pipe
- Parameters
pl The piped log structure - Return Value
- The native file descriptor
ap_piped_log_read_fd(pl);
- A macro to access the write side of the piped log pipe
- Parameters
pl The piped log structure - Return Value
- The native file descriptor
piped_log*ap_open_piped_log(apr_pool_t *p, const char *program);
- Open the piped log process
- Parameters
p The pool to allocate out of program The program to run in the logging process - Return Value
- The piped log structure
voidap_log_error(const char *file, int line, 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.
Use APLOG_MARK to fill out file and line @tip 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.
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.
- Parameters
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 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.
voidap_log_perror(const char *file, int line, 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.
Use APLOG_MARK to fill out file and line
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.
- Parameters
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 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.
voidap_log_rerror(const char *file, int line, 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 a printf-like format to log messages to the error_log.
Use APLOG_MARK to fill out file and line
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.
- Parameters
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 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.
voidap_log_cerror(const char *file, int line, 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 a printf-like format to log messages to the error_log.
Use APLOG_MARK to fill out file and line @tip If a request_rec is available, use that with ap_log_rerror() in preference to calling this function.
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. @note ap_log_cerror() is available starting with Apache 2.0.55.
- Parameters
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 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.
voidap_error_log2stderr(server_rec *s);
- Convert stderr to the error log
- Parameters
s The current server
voidap_close_piped_log(piped_log *pl);
- Close the piped log and kill the logging process
- Parameters
pl The piped log structure