[ https://issues.apache.org/jira/browse/LOGCXX-442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thorsten Schöning updated LOGCXX-442: ------------------------------------- Attachment: syslogappenderport.patch A patch has been proposed on the user slist: Hello, I have run into a small problem when trying to log to rsyslogd, running on a non-standard port number (i.e. not 514). When trying to configure the syslogappender in XML with something like this: <appender name="syslog" class="org.apache.log4j.net.SyslogAppender"> <param name="Facility" value="LOCAL1"/> <param name="SyslogHost" value="localhost:5140"/> <param name="Threshold" value="DEBUG"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p\t%C{2}\t(%F:%L)\t%m%n"/> </layout> </appender> The SyslogHost set to "localhost:5140" did not work. Failing with messages like: log4cxx: Cannot get information about host: localhost:5140 log4cxx: Could not find localhost:5140. All logging will FAIL. log4cxx: Cannot get information about host: localhost:5140 It turns out that the port number when using a remote syslogd is fixed with a #define SYSLOG_PORT 514 and the :<port> syntax is ignored or even causing an error. A bit of searching revealed that log4j *does* support this syntax, so it seems log4cxx should do the same. So I have had a go at fixing this - please see the attached patch. It does the job (i.e. works for me) and is not very complex - but I'm unsure if it is The Right (tm) solution... Please take a look and feel free to adopt this to the code base if it is useful. The patch was developed off the svn trunk rev 1652110. Cheers, Ulrik -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > Using non standard ports with syslog > ------------------------------------ > > Key: LOGCXX-442 > URL: https://issues.apache.org/jira/browse/LOGCXX-442 > Project: Log4cxx > Issue Type: New Feature > Components: Core > Affects Versions: 0.10.0 > Environment: Windows 2012 > Reporter: nov1ce > Priority: Minor > Attachments: syslogappenderport.patch > > > Hello, > Would it be feasible to add a possibility to use non standard ports with > syslog, either by specifying the :port at the SyslogHost part, or via > additional parameter (for example: <param name="Port" value="XXX" />? > It looks like it's hardcoded to 514/udp right now: > syslogwriter.cpp: > #define SYSLOG_PORT 514 > Thank you. -- This message was sent by Atlassian JIRA (v6.3.4#6332)