Skip to content

Commit

Permalink
Support unixgram syslog address
Browse files Browse the repository at this point in the history
- Consider unixgram:// as a valid URL prefix
- Parse unixgram:// addresses
- Update docs

Signed-off-by: Zhuoyun Wei <[email protected]>
  • Loading branch information
wzyboy committed Apr 28, 2016
1 parent 78076d5 commit 57fad95
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions daemon/logger/syslog/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ func parseAddress(address string) (string, string, error) {
return "", "", err
}

// unix socket validation
if url.Scheme == "unix" {
// unix and unixgram socket validation
if url.Scheme == "unix" || url.Scheme == "unixgram" {
if _, err := os.Stat(url.Path); err != nil {
return "", "", err
}
Expand Down
1 change: 1 addition & 0 deletions docs/admin/logging/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ The following logging options are supported for the `syslog` logging driver:

--log-opt syslog-address=[tcp|udp|tcp+tls]://host:port
--log-opt syslog-address=unix://path
--log-opt syslog-address=unixgram://path
--log-opt syslog-facility=daemon
--log-opt syslog-tls-ca-cert=/etc/ca-certificates/custom/ca.pem
--log-opt syslog-tls-cert=/etc/ca-certificates/custom/cert.pem
Expand Down
2 changes: 1 addition & 1 deletion pkg/urlutil/urlutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var (
validPrefixes = map[string][]string{
"url": {"http://", "https://"},
"git": {"git://", "github.com/", "git@"},
"transport": {"tcp://", "tcp+tls://", "udp://", "unix://"},
"transport": {"tcp://", "tcp+tls://", "udp://", "unix://", "unixgram://"},
}
urlPathWithFragmentSuffix = regexp.MustCompile(".git(?:#.+)?$")
)
Expand Down
1 change: 1 addition & 0 deletions pkg/urlutil/urlutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var (
"tcp+tls://example.com",
"udp://example.com",
"unix:///example",
"unixgram:///example",
}
)

Expand Down

0 comments on commit 57fad95

Please sign in to comment.