LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-27-2011, 11:37 AM   #1
laredotornado
Member
 
Registered: Apr 2011
Posts: 62

Rep: Reputation: 0
How do I write to the system log?


Hi,

I'm using Ubuntu 10.0.4. I downloaded an old script for starting/shutting down a service I have, and evidently "initlog" doesn't exist anymore. What is the correct way to write to the boot (system?) log?

Thanks, - Dave
 
Old 04-27-2011, 11:41 AM   #2
savona
Member
 
Registered: Mar 2011
Location: Bellmawr, NJ
Distribution: Red Hat / Fedora
Posts: 195

Rep: Reputation: 50
Quote:
Originally Posted by laredotornado View Post
Hi,

I'm using Ubuntu 10.0.4. I downloaded an old script for starting/shutting down a service I have, and evidently "initlog" doesn't exist anymore. What is the correct way to write to the boot (system?) log?

Thanks, - Dave
If I understand your question you want your script to write something to a log? You can just redirect the output to /var/log/messages (or any file of your choosing).

Some links to help you understand redirection:

http://linuxhelp.blogspot.com/2006/0...simple-in.html

http://www.linuxsa.org.au/tips/io-redirection.html

and a google search:
http://www.google.com/search?hl=en&s...=&oq=linux+red
 
Old 04-27-2011, 11:42 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Welcome to LQ

You can use logger
Code:
logger <your message here>
will write to
Code:
/var/log/messages
Kind regards
 
  


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
After log roll, Postfix cannot write to log file, Ubuntu 8.04 mboudro Linux - Server 6 09-17-2010 04:10 AM
Write log ust Linux - Newbie 6 07-07-2009 12:20 AM
write mail log to /var/log/maillog jimmyjiang Red Hat 4 01-15-2008 07:18 PM
how to get a script to write to a log paul_mat Linux - Software 8 05-26-2006 07:15 AM
Write results to log? eXor Linux - Software 2 06-12-2003 02:18 PM


All times are GMT -5. The time now is 02:32 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration