Skip to content

Commit

Permalink
mod_balance.c: Log throttled requests in warn log level instead of info
Browse files Browse the repository at this point in the history
log level.

Changed version to 1.2.
  • Loading branch information
DVD committed May 16, 2012
1 parent fa499b6 commit eb81f32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions mod_balance.c
Expand Up @@ -171,10 +171,10 @@ static int balance_handler(request_rec *r) {
}
if ( cfg->max_load > 0.0 && loadavg[0] > cfg->max_load ) {
#ifdef APACHE2
ap_log_rerror(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, 0, r, "[mod_balance] %s req. to %s%s reached MaxThrottleLoad(%.2f) and the load is %.2f",
ap_log_rerror(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, r, "[mod_balance] %s req. to %s%s reached MaxThrottleLoad(%.2f) and the load is %.2f",
r->content_type, r->hostname ? r->hostname : r->server->server_hostname, r->uri, cfg->max_load, loadavg[0]);
#else
ap_log_rerror(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, r, "[mod_balance] %s req. to %s%s reached MaxThrottleLoad(%.2f) and the load is %.2f",
ap_log_rerror(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, r, "[mod_balance] %s req. to %s%s reached MaxThrottleLoad(%.2f) and the load is %.2f",
r->content_type, r->hostname ? r->hostname : r->server->server_hostname, r->uri, cfg->max_load, loadavg[0]);
#endif
throttle = 1;
Expand Down Expand Up @@ -202,11 +202,11 @@ static int balance_handler(request_rec *r) {
ip_count++;
if ( cfg->ip_conns > 0 && ip_count >= cfg->ip_conns ) {
#ifdef APACHE2
ap_log_rerror(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, 0, r,
ap_log_rerror(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, r,
"[mod_balance] %s req. to %s%s reached MaxConnsPerIP(%d)",
r->content_type, r->hostname ? r->hostname : r->server->server_hostname, r->uri, ip_count);
#else
ap_log_rerror(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, r,
ap_log_rerror(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, r,
"[mod_balance] %s req. to %s%s reached MaxConnsPerIP(%d)",
r->content_type, r->hostname ? r->hostname : r->server->server_hostname, r->uri, ip_count);
#endif // APACHE2
Expand All @@ -219,11 +219,11 @@ static int balance_handler(request_rec *r) {
// check the Global connections limit
if ( cfg->global_conns > 0 && global_count >= cfg->global_conns ) {
#ifdef APACHE2
ap_log_rerror(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, 0, r,
ap_log_rerror(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, r,
"[mod_balance] %s req. to %s%s reached MaxGlobalConnections(%d)",
r->content_type, r->hostname ? r->hostname : r->server->server_hostname, r->uri, global_count);
#else
ap_log_rerror(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, r,
ap_log_rerror(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, r,
"[mod_balance] %s req. to %s%s reached MaxGlobalConnections(%d)",
r->content_type, r->hostname ? r->hostname : r->server->server_hostname, r->uri, global_count);
#endif // APACHE2
Expand Down Expand Up @@ -254,11 +254,11 @@ static int balance_handler(request_rec *r) {
vhost_count++;
if ( cfg->vhost_conns > 0 && vhost_count >= cfg->vhost_conns ) {
#ifdef APACHE2
ap_log_rerror(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, 0, r,
ap_log_rerror(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, r,
"[mod_balance] %s req. to %s%s reached MaxVhostConnections(%d)",
r->content_type, r->hostname ? r->hostname : r->server->server_hostname, r->uri, vhost_count);
#else
ap_log_rerror(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, r,
ap_log_rerror(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, r,
"[mod_balance] %s req. to %s%s reached MaxVhostConnections(%d)",
r->content_type, r->hostname ? r->hostname : r->server->server_hostname, r->uri, vhost_count);
#endif
Expand All @@ -280,7 +280,7 @@ static int balance_handler(request_rec *r) {
if (r->server->server_uid == vhost->server_uid) {
user_count++;
if ( cfg->user_conns > 0 && user_count >= cfg->user_conns ) {
ap_log_rerror(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, r,
ap_log_rerror(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, r,
"[mod_balance] %s req. to %s%s reached MaxUserConnections(%d) of UID %d",
r->content_type, r->hostname ? r->hostname : r->server->server_hostname, r->uri, user_count, r->server->server_uid);
throttle = 1;
Expand Down
2 changes: 1 addition & 1 deletion mod_balance.h
Expand Up @@ -30,7 +30,7 @@ APLOG_USE_MODULE(balance);
#include <stdio.h>
#endif

#define BALANCE_VERSION "mod_balance/1.1"
#define BALANCE_VERSION "mod_balance/1.2"
#define DYNAMIC_SLEEP 5
#define STATIC_SLEEP 2
#define IP_CONNS 0
Expand Down

0 comments on commit eb81f32

Please sign in to comment.