|
Home > Archive > Unix Shell > October 2006 > application unable to make a syslog entry
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
application unable to make a syslog entry
|
|
| ranjayap@gmail.com 2006-10-23, 1:16 pm |
| Hi Everybody,
I've the following c program that makes a syslog entry into
/var/log/messages the default syslog file [pl ref /etc/syslog.conf for
this entry]. After running this program for couple of minutes i'm not
able to see any entries in /var/log/messages
The c program has been built using the default cc compiler that comes
with linux
However the same program works on other platforms
#include <unistd.h>
#include <sys/syslog.h>
#include <stdio.h>
int main(){
char mesg_buf[1000];
int countx=0;
while (1) {
sprintf(mesg_buf,"MESSAGE FROM SYSLOG [%s][%d]",__FILE__);
syslog(LOG_INFO,mesg_buf);
countx++;
sleep (5)
}
return 0;
}
Other details related to my linux box
===========================
cat /etc/issue
Red Hat Enterprise Linux ES release 4 (Nahant)
Kernel \r on an \m
uname -v -r -a
2.6.9-5.EL #1 Wed Jan 5 19:22:18 EST 2005 i686 i686 i386 GNU/Linux
That's all . Looking forward to help from the community experts
Any help would be highly appreciated
Thanks
Ranjaya
| |
| Barry Margolin 2006-10-24, 1:22 am |
| In article <1161610109.948952.128740@k70g2000cwa.googlegroups.com>,
ranjayap@gmail.com wrote:
> Hi Everybody,
>
> I've the following c program that makes a syslog entry into
> /var/log/messages the default syslog file [pl ref /etc/syslog.conf for
> this entry]. After running this program for couple of minutes i'm not
> able to see any entries in /var/log/messages
Show us your syslog.conf. Maybe it's not configured to send *.info to
/var/log/messages.
>
> The c program has been built using the default cc compiler that comes
> with linux
>
> However the same program works on other platforms
>
> #include <unistd.h>
> #include <sys/syslog.h>
> #include <stdio.h>
>
> int main(){
> char mesg_buf[1000];
> int countx=0;
> while (1) {
> sprintf(mesg_buf,"MESSAGE FROM SYSLOG [%s][%d]",__FILE__);
> syslog(LOG_INFO,mesg_buf);
> countx++;
> sleep (5)
>
> }
> return 0;
> }
>
>
> Other details related to my linux box
> ===========================
> cat /etc/issue
> Red Hat Enterprise Linux ES release 4 (Nahant)
> Kernel \r on an \m
>
> uname -v -r -a
> 2.6.9-5.EL #1 Wed Jan 5 19:22:18 EST 2005 i686 i686 i386 GNU/Linux
>
> That's all . Looking forward to help from the community experts
>
> Any help would be highly appreciated
>
> Thanks
> Ranjaya
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
|
|
|
|
|