LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-25-2006, 08:46 PM   #1
sidra
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora Core 3, Red Hat 9, CentOS 4.2, Mandriva, Ret Hat Enterprise Linux 4.0
Posts: 116

Rep: Reputation: 15
syslog-ng output


Hi,

I'm trying to create a a logging system for some applications using ACE Logging strategies and directing the output from the code to syslog-ng. I'm trying to get syslog-ng to print out the line # from where the message was directed to the log file. By default the output doesn't contain any line # information. Is there an easy way to do this?

Thanks in advance!
 
Old 07-26-2006, 04:08 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
what do you mean by "line #"? you want each new line to have the total number of lines in the file? could you give us more context about your situation?
 
Old 07-26-2006, 04:33 PM   #3
sidra
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora Core 3, Red Hat 9, CentOS 4.2, Mandriva, Ret Hat Enterprise Linux 4.0
Posts: 116

Original Poster
Rep: Reputation: 15
You know how in the syslog output the text message is displayed from whereever the debug statement was, i need to output the line# in the file from where the message is coming from in the syslog output
 
Old 07-26-2006, 04:36 PM   #4
sidra
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora Core 3, Red Hat 9, CentOS 4.2, Mandriva, Ret Hat Enterprise Linux 4.0
Posts: 116

Original Poster
Rep: Reputation: 15
For instance this is a call at line 36 in my file called "Use_Syslog.cpp":

MY_INFO( ACE_TEXT ("Testing Macro\n") );

This ouput is directed to syslog-ng's /var/log/messages file. This message is displayed but i also want line 36 as part of the /var/log/messages file entry. I'm able to display the file name but not the line #

Thanks!
 
Old 07-27-2006, 01:42 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
how is syslog-ng supposed to know that information?? sounds like this is actually a C++ question aobut how to get that line number within the code.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No output to /var/log/messages or ~syslog eelriver Slackware 5 07-18-2004 05:13 AM
separating syslog output by application mscott Linux - Software 0 03-08-2004 11:45 AM
Syslog and iptables, output going to console diverge LinuxQuestions.org Member Success Stories 1 12-29-2003 10:07 AM
syslog, iptables, and customizing the output JFoster Linux - General 0 11-29-2003 01:12 AM
syslog output vexer Slackware 5 06-18-2003 02:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration