plugin/log: log remote port addr as well (#1573)

Log the remote's port, for IPv6 addr this means we should enclose the v6
address in brackets; make this the default for 'remote'.
This commit is contained in:
Miek Gieben
2018-02-28 18:15:12 -08:00
committed by GitHub
parent 74825a46f2
commit 5faa9e7bc1
3 changed files with 12 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ type Rule struct {
const (
// CommonLogFormat is the common log format.
CommonLogFormat = `{remote} ` + CommonLogEmptyValue + ` [{when}] {>id} "{type} {class} {name} {proto} {size} {>do} {>bufsize}" {rcode} {>rflags} {rsize} {duration}`
CommonLogFormat = `{remote}:{port} ` + CommonLogEmptyValue + ` [{when}] {>id} "{type} {class} {name} {proto} {size} {>do} {>bufsize}" {rcode} {>rflags} {rsize} {duration}`
// CommonLogEmptyValue is the common empty log value.
CommonLogEmptyValue = "-"
// CombinedLogFormat is the combined log format.