Changes with Apache 2.3.7
+ *) Log command line on startup, so there's a record of command line
+ arguments like -f.
+ PR 48752. [Dan Poirier]
+
*) Introduce mod_reflector, a handler capable of reflecting POSTed
request bodies back within the response through the output filter
stack. Can be used to turn an output filter into a web service.
* 20091230.4 (2.3.6-dev) export ap_process_request_after_handler() for mod_serf
* 20100208.0 (2.3.6-dev) ap_socache_provider_t API changes to store and iterate
* 20100208.1 (2.3.6-dev) Added forward member to proxy_conn_rec
+ * 20100215.0 (2.3.7-dev) Added ap_log_command_line().
*
*/
*/
AP_DECLARE(void) ap_error_log2stderr(server_rec *s);
+/**
+ * Log the command line used to start the server.
+ * @param p The pool to use for logging
+ * @param s The server_rec whose process's command line we want to log.
+ * The command line is logged to that server's error log.
+ */
+AP_DECLARE(void) ap_log_command_line(apr_pool_t *p, server_rec *s);
+
/**
* Log the current pid of the parent process
* @param p The pool to use for logging
va_end(args);
}
+AP_DECLARE(void) ap_log_command_line(apr_pool_t *plog, server_rec *s)
+{
+ int i;
+ process_rec *process = s->process;
+ char *result;
+ int len_needed = 0;
+
+ /* Piece together the command line from the pieces
+ * in process->argv, with spaces in between.
+ */
+ for (i = 0; i < process->argc; i++) {
+ len_needed += strlen(process->argv[i]) + 1;
+ }
+
+ result = (char *) apr_palloc(plog, len_needed);
+ *result = '\0';
+
+ for (i = 0; i < process->argc; i++) {
+ strcat(result, process->argv[i]);
+ if ((i+1)< process->argc) {
+ strcat(result, " ");
+ }
+ }
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s,
+ "Command line: '%s'", result);
+}
+
AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *filename)
{
apr_file_t *pid_file = NULL;
ap_get_server_description());
ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
"Server built: %s", ap_get_server_built());
+ ap_log_command_line(plog, s);
restart_pending = shutdown_pending = 0;
mpm_state = AP_MPMQ_RUNNING;
ap_get_server_description());
ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
"Server built: %s", ap_get_server_built());
+ ap_log_command_line(plog, s);
show_server_data();
mpm_state = AP_MPMQ_RUNNING;
ap_get_server_description());
ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
"Server built: %s", ap_get_server_built());
+ ap_log_command_line(plog, s);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
"Accept mutex: %s (default: %s)",
apr_proc_mutex_name(accept_mutex),
ap_get_server_description());
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf,
"Server built: %s", ap_get_server_built());
+ ap_log_command_line(plog, s);
restart = master_main(ap_server_conf, shutdown_event, restart_event);
ap_get_server_description());
ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
"Server built: %s", ap_get_server_built());
+ ap_log_command_line(plog, s);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
"Accept mutex: %s (default: %s)",
apr_proc_mutex_name(accept_mutex),