Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to let your own application write to the log file 2

Status
Not open for further replies.

Themuppeteer

Programmer
Apr 4, 2001
449
0
0
BE
Can you let your own application write to the linux log file ? (/var/log/messages) Greetz,
muppeteer.gif


NOSPAM_themuppeteer@hotmail.com (for mails, remove the NOSPAM_)

"Those who say they understand chess, understand nothing"

-- Robert HUBNER
 

/var/log/messages is not a linux log file but a syslog file. Syslog is basically just a filter for messages.

I think the call 'syslog(level, text)' writes to syslog.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
echo `my message to add to logfile` >> /var/log/messages
(you will need root permission)
 
Or use logger if you use shell scripting!
Try "man logger"

Kjetil
 
I works!


There I found the info about syslog.
I also tried the second suggestion and it worked to.
Thnx guys! Greetz,
muppeteer.gif


NOSPAM_themuppeteer@hotmail.com (for mails, remove the NOSPAM_)

"Those who say they understand chess, understand nothing"

-- Robert HUBNER
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top