Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

syslog in vxWorks

759 views
Skip to first unread message

changwoo

unread,
Aug 21, 2002, 9:31:01 AM8/21/02
to
vxWorks..

I need the syslog for logging messages to UNIX.
I tried it as follow which was mentioned before but it didn't work.

"
Open a UDP socket (port 514) to the syslogd running on your unix host
and pass the socket's file
descriptor to logInit() - no need to 'modify' logLib.
"
"
/* revised code */
if((sFd = socket(AF_INET, SOCK_DGRAM, 0)) == ERROR)
{
printf("socket\n");
}
sockAddrSize = sizeof(struct sockaddr_in);
bzero((char*) &serverAddr, sockAddrSize);
serverAddr.sin_len = (u_char)sockAddrSize;
serverAddr.sin_port = htons(514);
serverAddr.sin_addr.s_addr = inet_addr("200.100.12.244");
if (connect(sFd, &serverAddr, sockAddrSize) < 0)
{
printf("error connect syslog socket\n");
}
logInit (sFd, MAX_LOG_MSGS); /* initialize logging */
"

If you know how to solve this or have the source code about syslog client,
please send me a message. thanks

Leonid Rosenboim

unread,
Aug 21, 2002, 11:42:21 AM8/21/02
to
THis did not work because syslog has a rather simple protocol on top of UDP,
the packet needs to begin with a few headers, including process id, message
facility and priority, timestamp, and only after those comes the message
text.

If you insist on itegrating your syslog client with logLib, you need to pass
logTask a file descriptor of a PIPE, and have your own task read the messaes
from the pipe, add headers etc., and send it over to the syslog server.

"changwoo" <cw...@korealink.ne.kr> wrote in message
news:3d64ee1a.02082...@posting.google.com...

0 new messages