len = ngx_sock_ntop(c->sockaddr, c->socklen, text, NGX_SOCKADDR_STRLEN, 1);
- ngx_log_error(NGX_LOG_INFO, c->log, 0, "*%uA client %*s connected to %V",
- c->number, len, text, &addr_conf->addr_text);
+ ngx_log_error(NGX_LOG_INFO, c->log, 0, "*%uA %sclient %*s connected to %V",
+ c->number, c->type == SOCK_DGRAM ? "udp " : "",
+ len, text, &addr_conf->addr_text);
c->log->connection = c->number;
c->log->handler = ngx_stream_log_error;
s = log->data;
- p = ngx_snprintf(buf, len, ", client: %V, server: %V",
+ p = ngx_snprintf(buf, len, ", %sclient: %V, server: %V",
+ s->connection->type == SOCK_DGRAM ? "udp " : "",
&s->connection->addr_text,
&s->connection->listening->addr_text);
len -= p - buf;
handler = c->log->handler;
c->log->handler = NULL;
- ngx_log_error(NGX_LOG_INFO, c->log, 0, "proxy %V connected to %V",
+ ngx_log_error(NGX_LOG_INFO, c->log, 0,
+ "%sproxy %V connected to %V",
+ pc->type == SOCK_DGRAM ? "udp " : "",
&str, u->peer.name);
c->log->handler = handler;
c->log->handler = NULL;
ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "%s disconnected"
+ "%s%s disconnected"
", bytes from/to client:%O/%O"
", bytes from/to upstream:%O/%O",
+ src->type == SOCK_DGRAM ? "udp " : "",
from_upstream ? "upstream" : "client",
s->received, c->sent, u->received, pc ? pc->sent : 0);