Need to redirect the messages


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Need to redirect the messages
# 1  
Old 06-25-2002
Need to redirect the messages

Hi,

Some of the process execuating on our server time to time. Time of exeuation is not know in advance. That process is producing some of the messages on the screen. I want to redirect all the messages in one file as well as want all the message on the screen also. How i can do that ?
# 2  
Old 06-25-2002
Please post OS information if the following does not help:

Look at /etc/syslog.conf and/or man syslogd. syslog.conf (or the equivalent file for your OS) controls what messages go where.

Since you want all messages to the console AND to a file, check first to see if this is already happening. Cat out the syslog.conf file and look for something like the following:


*.emerg;*.err;*.alert;*.crit;*.warning;*.notice;*.debug /var/adm/messages
*.emerg;*.err;*.alert;*.crit;*.warning;*.notice;*.debug /dev/console

If you do have this, then you just need to go look at the file to see that it is getting any messages. To see if it's working, attempt to su to root and put the wrong password. A message should show up in the messages file along with the console.
If you don't have this yet, edit the syslog.conf file (after saving a copy) and add the lines as you want. Restart syslogd. Check that it's working.

Make sure you read the man page. Your server may well be different than I am describing (I'm using Solaris as an example)

To send messages to another server (a syslog host which collects all messages from all servers) use the following:
*.emerg;*.err;*.alert;*.crit;*.warning;*.notice;*.debug @syslog1.mydomain.com
# 3  
Old 06-25-2002
Hi,

Thanks for your reply. I got the file syslog.conf. But how it work for one particular process. Like i have the process name "ccstart". What i have to do to get all the messages in the log file created by that process. But i also want all the messages related to that process only nothing else in that message file.

Regards,

Quote:
Originally posted by RTM
Please post OS information if the following does not help:

Look at /etc/syslog.conf and/or man syslogd. syslog.conf (or the equivalent file for your OS) controls what messages go where.

Since you want all messages to the console AND to a file, check first to see if this is already happening. Cat out the syslog.conf file and look for something like the following:


*.emerg;*.err;*.alert;*.crit;*.warning;*.notice;*.debug /var/adm/messages
*.emerg;*.err;*.alert;*.crit;*.warning;*.notice;*.debug /dev/console

If you do have this, then you just need to go look at the file to see that it is getting any messages. To see if it's working, attempt to su to root and put the wrong password. A message should show up in the messages file along with the console.
If you don't have this yet, edit the syslog.conf file (after saving a copy) and add the lines as you want. Restart syslogd. Check that it's working.

Make sure you read the man page. Your server may well be different than I am describing (I'm using Solaris as an example)

To send messages to another server (a syslog host which collects all messages from all servers) use the following:
*.emerg;*.err;*.alert;*.crit;*.warning;*.notice;*.debug @syslog1.mydomain.com
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ftp redirect

Hi i want to redirect a list of ftp file to an exsisting file by mls x.txt mylocalfile.txt result of this command corrupt my data on mylocalfile.txt , please help me (2 Replies)
Discussion started by: rezasadeghi
2 Replies

2. Shell Programming and Scripting

How to redirect the messages from the script to console in Linux?

msg.sh #!/bin/bash if then echo "starting service" else echo " service not started" echo " Please check the start.sh file or manuly start the service" fi if i login with root credentials @12.36.34.123 with passwd username:root passwd:abc once i login into linux pc... (6 Replies)
Discussion started by: saku
6 Replies

3. Web Development

.htaccess redirect with #

I have the following directive in my .htaccess: #RewriteRule ^mozrank/?$ "http://www.seobook.com/#a_aid=dh" The problem is that the redirect is going to http://www.seobook.com/%23a_aid=dh How to preserve the # when redirecting? (2 Replies)
Discussion started by: rlopes
2 Replies

4. Shell Programming and Scripting

Redirect Output

Hi, I would like to list files: ls *.hdf But I would like a copy of the output directed to the screen, but also APPENDED to a text file: test.txt I have tried: ls *.hdf | tee test.txt However, that will just write over everything already existing in test.txt. How can I append the... (1 Reply)
Discussion started by: msb65
1 Replies

5. SCO

Redirect archive0?

Hello UNIX-community, We have an older SCO UNIX-system running PCS3 (an industrial platform) and since a few weeks we are experiencing problems with our archiving software. For about ten years, the system archives data to Magneto-Optical discs (MO-discs) and thus far it has worked fine.... (0 Replies)
Discussion started by: V4Friend
0 Replies

6. HP-UX

How to Redirect the error messages from Syslog file to our own Application Log File

Hello, I am New to Unix. I am Using HP-UX 9000 Series for my Application. I am Currently Facing an Issue that the error messages are being written in the syslog file instead of the Application Log File. The Codes for that Syslog.h is written in Pro*C. I want to know how to Redirect these... (3 Replies)
Discussion started by: balasubramaniam
3 Replies

7. Shell Programming and Scripting

Redirect output

Hi all, I have a script which call a java program, the logging (to log file) in the program is done using log4j. However, as a safety measure, i still choose to direct standard error to another log file as follow /usr/bin/java -classpath ${classpath} -Xmx128m TestingProgram 2>>... (1 Reply)
Discussion started by: mpang_
1 Replies

8. Shell Programming and Scripting

Redirect messages

I have this script which invoke a java program and in the program I have several System.out.println statement to write messages to standard output, I wanna to redirect these to a log file so I did java blah blah blah > log.txt 2>&1 but I can't see any of those messages, can anybody help?... (2 Replies)
Discussion started by: mpang_
2 Replies

9. Shell Programming and Scripting

redirect exception messages from program

Hi, I have a script which invoke a java program and I would like to know whether it is possible to log the exception thrown by the program to a log file in the script? Thanks! (1 Reply)
Discussion started by: mpang_
1 Replies

10. IP Networking

Redirect

I'm sittig behind a firewall that doesn't allow ftp. I have a conection to a UNIX system, connecting throug SSH. Is it possible to redirect the ftp through the UNIX to my computer? (1 Reply)
Discussion started by: <Therapy>
1 Replies
Login or Register to Ask a Question