Changeset 6286:a6a2016b8e31 in nginx


Ignore:
Timestamp:
10/26/15 16:06:42 (4 years ago)
Author:
Vladimir Homutov <vl@…>
Branch:
default
Phase:
public
Message:

Syslog: added "nohostname" option.

The option disables sending hostname in the syslog message header. This is
useful with syslog daemons that do not expect it (tickets #677 and #783).

Location:
src/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/core/ngx_syslog.c

    r5922 r6286  
    195195            peer->tag.len = len - 4;
    196196
     197        } else if (len == 10 && ngx_strncmp(p, "nohostname", 10) == 0) {
     198            peer->nohostname = 1;
     199
    197200        } else {
    198201            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
     
    221224    pri = peer->facility * 8 + peer->severity;
    222225
     226    if (peer->nohostname) {
     227        return ngx_sprintf(buf, "<%ui>%V %V: ", pri, &ngx_cached_syslog_time,
     228                           &peer->tag);
     229    }
     230
    223231    return ngx_sprintf(buf, "<%ui>%V %V %V: ", pri, &ngx_cached_syslog_time,
    224232                       &ngx_cycle->hostname, &peer->tag);
  • src/core/ngx_syslog.h

    r5857 r6286  
    1717    ngx_addr_t        server;
    1818    ngx_connection_t  conn;
    19     ngx_uint_t        busy;  /* unsigned busy:1; */
     19    unsigned          busy:1;
     20    unsigned          nohostname:1;
    2021} ngx_syslog_peer_t;
    2122
Note: See TracChangeset for help on using the changeset viewer.