Skip to content

Commit

Permalink
Tweak log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jajik committed Oct 23, 2023
1 parent 73c8a91 commit 8ae0035
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 128 deletions.
15 changes: 8 additions & 7 deletions native/advertise/mod_advertise.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,8 @@ static int post_config_hook(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pte
if (ppid) {
ma_parent_pid = atol(ppid);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
"[%" APR_PID_T_FMT " - %" APR_PID_T_FMT "] in child post config hook", getpid(),
ma_parent_pid);
"post_config_hook: [%" APR_PID_T_FMT " - %" APR_PID_T_FMT "] in child post config hook",
getpid(), ma_parent_pid);
return OK;
}
}
Expand All @@ -608,7 +608,7 @@ static int post_config_hook(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pte
rv = ma_group_join(mconf->ma_advertise_adrs, mconf->ma_advertise_port, mconf->ma_bind_adrs, mconf->ma_bind_port,
pconf, s);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, "mod_advertise: multicast join failed for %s:%d.",
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, "post_config_hook: multicast join failed for %s:%d.",
mconf->ma_advertise_adrs, mconf->ma_advertise_port);
ma_advertise_run = 0;
} else {
Expand Down Expand Up @@ -651,23 +651,23 @@ static int post_config_hook(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pte
rv = apr_parse_addr_port(&mconf->ma_advertise_srvs, &mconf->ma_advertise_srvi, &mconf->ma_advertise_srvp, ptr,
pproc);
if (rv != APR_SUCCESS || !mconf->ma_advertise_srvs || !mconf->ma_advertise_srvp) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, "mod_advertise: Invalid ServerAdvertise Address %s", ptr);
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, "post_config_hook: Invalid ServerAdvertise Address %s", ptr);
return rv;
}
}

/* prevent X-Manager-Address: (null):0 */
if (!mconf->ma_advertise_srvs || !mconf->ma_advertise_srvp) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s,
"mod_advertise: ServerAdvertise Address or Port not defined, Advertise disabled!!!");
"post_config_hook: ServerAdvertise Address or Port not defined, Advertise disabled!!!");
return OK;
}

/* Create parent management thread */
is_mp_running = 1;
rv = apr_thread_create(&tp, NULL, parent_thread, server, pconf);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, "mod_advertise: parent apr_thread_create");
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, "post_config_hook: parent apr_thread_create");
return rv;
}
apr_thread_detach(tp);
Expand All @@ -678,7 +678,8 @@ static int post_config_hook(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pte
apr_pool_create(&magd->cpool, pconf);
apr_pool_cleanup_register(magd->cpool, magd, pconfig_cleanup, apr_pool_cleanup_null);

ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, "Advertise initialized for process %" APR_PID_T_FMT, getpid());
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, "post_config_hook: Advertise initialized for process %" APR_PID_T_FMT,
getpid());

apr_pool_cleanup_register(magd->ppool, magd, process_cleanup, apr_pool_cleanup_null);

Expand Down
9 changes: 6 additions & 3 deletions native/balancers/mod_lbmethod_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,17 +395,20 @@ static int lbmethod_cluster_post_config(apr_pool_t *p, apr_pool_t *plog, apr_poo
mc_watchdog_get_instance = APR_RETRIEVE_OPTIONAL_FN(ap_watchdog_get_instance);
mc_watchdog_register_callback = APR_RETRIEVE_OPTIONAL_FN(ap_watchdog_register_callback);
if (!mc_watchdog_get_instance || !mc_watchdog_register_callback) {
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(03262) "mod_watchdog is required");
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s,
APLOGNO(03262) "proxy_cluster_post_config: mod_watchdog is required");
return !OK;
}
if (mc_watchdog_get_instance(&watchdog, LB_CLUSTER_WATHCHDOG_NAME, 0, 1, p)) {
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(03263) "Failed to create watchdog instance (%s)",
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s,
APLOGNO(03263) "proxy_cluster_post_config: Failed to create watchdog instance (%s)",
LB_CLUSTER_WATHCHDOG_NAME);
return !OK;
}
while (s) {
if (mc_watchdog_register_callback(watchdog, AP_WD_TM_SLICE, s, mc_watchdog_callback)) {
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(03264) "Failed to register watchdog callback (%s)",
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s,
APLOGNO(03264) "proxy_cluster_post_config: Failed to register watchdog callback (%s)",
LB_CLUSTER_WATHCHDOG_NAME);
return !OK;
}
Expand Down
Loading

0 comments on commit 8ae0035

Please sign in to comment.