LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-14-2008, 06:47 AM   #1
noir911
Member
 
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
logging message on both remote and local server


Does anyone know how to log /var/log/message to a remote and the local system at the same time? I can very easily send /var/log/messages logs to a remote syslog-ng server but how do I log it in the local system at the same time? The local systems use either syslogd or syslog-ng.

Thanks for any help.
 
Old 10-14-2008, 09:34 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 24,314

Rep: Reputation: 7149Reputation: 7149Reputation: 7149Reputation: 7149Reputation: 7149Reputation: 7149Reputation: 7149Reputation: 7149Reputation: 7149Reputation: 7149Reputation: 7149
Quote:
Originally Posted by noir911 View Post
Does anyone know how to log /var/log/message to a remote and the local system at the same time? I can very easily send /var/log/messages logs to a remote syslog-ng server but how do I log it in the local system at the same time? The local systems use either syslogd or syslog-ng.

Thanks for any help.
If you're already familiar with syslog-ng, you can easily do this. Just specify two locations for syslog messages, a local file, and a remote syslog server, in your syslog-ng config.
 
Old 10-22-2008, 08:46 PM   #3
noir911
Member
 
Registered: Apr 2004
Posts: 682

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
If you're already familiar with syslog-ng, you can easily do this. Just specify two locations for syslog messages, a local file, and a remote syslog server, in your syslog-ng config.
Thanks for your help. Could you please give me an example?
 
Old 10-22-2008, 11:13 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Just add two entries in your syslog.conf file for the given facility/priority. Specify different actions for each, one going to the normal log file (if there isn't already an entry for this) and the other going to the network syslog server.
 
Old 10-23-2008, 12:51 AM   #5
noir911
Member
 
Registered: Apr 2004
Posts: 682

Original Poster
Rep: Reputation: Disabled
I have resolved this. Here's how it's done:

On the client edit /etc/syslog-ng/syslog-ng.conf and add

Code:
destination logserver { udp("<IP_of_Log_Server>" port(514)); };
Also add the following

Code:
destination messages { file("/var/log/messages"); };
log { source(src); filter(f_messages); destination(logserver); };

The above should be added right after

Code:
destination messages { file("/var/log/messages"); };
log { source(src); filter(f_messages); destination(messages); };
save the file and exit.

restart the syslog-ng daemon (/etc/init.d/syslog restart)

Now anything that gets logged in to /var/log/messages will also get logged in to the remote servers /path/to/hostname file.
 
  


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
[syslog-ng] logging remote server by IP address noir911 Linux - Server 4 06-22-2018 09:01 AM
local X server, remote application frankie_DJ Linux - Newbie 6 06-14-2006 11:00 PM
Remote Server, Local Printing, on Windows coolamit78 General 0 06-11-2005 05:01 AM
logging to a remote syslog server is dropping packets draeician73 Linux - Security 1 10-20-2004 07:19 PM
Updating a remote server with a local cd korozion Linux - General 4 07-15-2004 05:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:47 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