Summary: | Feature Request: Add SyslogPort option to SyslogAppender | ||
---|---|---|---|
Product: | Log4j - Now in Jira | Reporter: | Gunter Zeilinger <gunterze> |
Component: | Appender | Assignee: | log4j-dev <log4j-dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.3alpha | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
log4j-trunk-add-SyslogPort-option.patch
log4j-v1_2-branch-add-SyslogPort-option.patch support host:port syntax (log4j-trunk) support host:port syntax (log4j-v1_2-branch) |
Description
Gunter Zeilinger
2006-05-30 19:54:10 UTC
Created attachment 18372 [details]
log4j-trunk-add-SyslogPort-option.patch
Created attachment 18373 [details]
log4j-v1_2-branch-add-SyslogPort-option.patch
Any thoughts on supporting :portno syntax on the existing syslogHost property? So that if you specified syslogHost="syslog.example.com", it would go to port 514 on "syslog.example.com" but syslogHost="syslog.example.com:1514" would go to port 1514? I have no preference. Created attachment 18376 [details]
support host:port syntax (log4j-trunk)
Created attachment 18377 [details]
support host:port syntax (log4j-v1_2-branch)
Committed a slightly different take in rev 438792 to the log4j-1_2 branch and 438801 to the trunk. Adding a separate "port" property to SyslogAppender (as suggested in first set of patches) was problematic since SyslogWriter is created on the call ot setSyslogPort() and order of calling setSyslogPort() and setSyslogHost() could be arbitrary when using configurators. The second set of patches would break support for naked IPv6 addresses which would contain colons but would now be interpreted as an address and a port. The committed patch will use java.net.URL to parse the syslogHost property except when the property contains more than one colon and does not start with a left bracket. The following forms should still be supported: Host name: foo.example.org IPv4: 127.0.0.1 IPv6: ::1 The following forms are added: Host and port: foo.example.org:1514 IPv4 and port: 127.0.0.1:1514 IPv6 (URL form): [::1] IPv6 and port: [::1]:1514 Would appreciate any feedback. |