[syslog-ng]using perl module with syslog-ng
John Morrissey
jwm@rpa.net
Wed, 18 Jul 2001 19:09:31 -0400
On Wed, Jul 18, 2001 at 05:11:37PM -0400, Ravi Malghan wrote:
% I noticed that the syslog module on default uses udp port 514 when used as below. I am running the syslog-ng deamon
% on a tcp port 4477 which is why I was not getting the logs.
%
% ==============
% use Sys::Syslog;
%
% openlog('Test', 'pid', 'user');
% $n=$ARGV[0];
% syslog('err', 'Logging a Test Message %d', $n);
% ==============
%
% How do I specify it to use a tcp port to use instead?
try logging to a local socket instead; Sys::Syslog doesn't support tcp
sockets.
use Sys::Syslog qw(:DEFAULT setlogsock);
setlogsock('unix');
openlog('Test', 'pid', 'user');
syslog('info', 'foo');
closelog();
john
--
John Morrissey _o /\ ---- __o
RPA Internet _-< \_ / \ ---- < \,
jwm@rpa.net __(_)/_(_)________/ \_______(_) /_(_)__