LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-20-2009, 10:10 AM   #1
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 346

Rep: Reputation: 31
remote syslogging


I have 5 webservers which I wish to log each of them remotely to one box. From my readings, http://www.oreillynet.com/pub/a/sysa...pd-syslog.html and others, and I guess something is just not clicking. 1st is I only wish to monitor the apache access (and error) logs. So I have one of the webservers /etc/syslog.conf entry added;
local3.* @remote server ip

on the server I restarted syslog with the -r remote option, ps aux shows;

root 2738 0.0 0.0 2092 724 ? Ss Jan19 0:16 syslogd -m 0 -r

So, what's next or what's wrong? I hit the website a bit, but the readings so far haven't shown how to test a bit more, or ensure things are right, etc.

Thanks for any help or tips on people already doing this.

Lr
 
Old 01-20-2009, 10:55 AM   #2
whitemice
Member
 
Registered: Aug 2007
Location: Michigan, USA
Distribution: openSUSE
Posts: 52

Rep: Reputation: 15
Is Apache logging via syslog?

Quote:
Originally Posted by sir-lancealot View Post
I have 5 webservers which I wish to log each of them remotely to one box. From my readings, http://www.oreillynet.com/pub/a/sysa...pd-syslog.html and others, and I guess something is just not clicking. 1st is I only wish to monitor the apache access (and error) logs. So I have one of the webservers /etc/syslog.conf entry added;
local3.* @remote server ip
on the server I restarted syslog with the -r remote option, ps aux shows;
root 2738 0.0 0.0 2092 724 ? Ss Jan19 0:16 syslogd -m 0 -r
So, what's next or what's wrong? I hit the website a bit, but the readings so far haven't shown how to test a bit more, or ensure things are right, etc.
Thanks for any help or tips on people already doing this.
Lr
Is Apache logging via syslog? By default I do not believe that it uses syslog but writes logs directly. If you send local3.* to a local file do entries appear? If so check that your remote syslog (netstat --listen --inet) is listening on the network interface AND that your firewall is down for the syslog port (UDP/514 or UDP/601).
 
Old 01-20-2009, 12:49 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Here's info on logging via syslog in httpd.confhttp://www.oreillynet.com/pub/a/sysa...pd-syslog.html

Looking at that though, I don't like their method of a perl wrapper, when you have logger available:

CustomLog "| /usr/bin/logger -p local.info" common

would do it with no scripting at all.

Also i'd really recommend checking out syslog-ng over syslogd, much nicer to configure and more powerful especially when you have networked logging requirements.

Last edited by acid_kewpie; 01-20-2009 at 12:54 PM.
 
Old 01-20-2009, 12:52 PM   #4
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 346

Original Poster
Rep: Reputation: 31
Thanks for the reply. I am unclear no how to 'send local3.* to a local file'. I am reading in parallel to try to understand it a bit more but the firewall and listen is fine (see below)

netstat --listen --inet | grep syslog
udp 0 0 *:syslog *:*

I am trying to figure out/understand it a bit more.

Thanks
 
Old 01-20-2009, 12:53 PM   #5
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 346

Original Poster
Rep: Reputation: 31
Thanks for the URL, it's the same one I posted in the original post though.
 
Old 01-20-2009, 12:55 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
omg, what a cretin. so sorry, read the first reply and went with it!

I edited my reply since then though, any more use?

also especially in a UDP world, tcpdump is so so useful to see if the udp packets are a) leaving the client and b) hitting the server.

Last edited by acid_kewpie; 01-20-2009 at 12:56 PM.
 
Old 01-21-2009, 02:09 PM   #7
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 346

Original Poster
Rep: Reputation: 31
lol, cretin... nah. The amount of posting you do, your allowed a little slack sometimes

So, I checked and edited my vhost so it now looks like this;

CustomLog logs/domain.com-access_log combined
CustomLog "| /usr/bin/logger -p local.info" common

I see no local.info file on either the local or remote server, so I looked in the general error_log and saw this;
piped log program ' /usr/bin/logger -p local.info' failed unexpectedly
logger: unknown facility name: local.

As for syslog-ng, I have used it in the past for direct postgres logging, but if you think this is a better route, I will do some reading and go that route ... tnx

hmmmmm....

Last edited by sir-lancealot; 01-21-2009 at 02:10 PM.
 
Old 01-21-2009, 03:04 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
OK, well the facility is only for your reference later on. you can change it to whatever you want, and even remove it for initial testing.
 
  


Reply



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
Syslogging to somewhere other than /var... ddenton Linux - Server 5 08-13-2007 09:40 AM
Secure syslogging [slack] darklogik_org Linux - Security 13 01-28-2004 01:21 PM
Simulating remote syslogging ganninu Linux - General 0 12-09-2003 02:45 AM
Remote + local syslogging at the same time ganninu Linux - General 9 12-03-2003 02:21 AM
Syslogging from shell script Hko Programming 2 12-16-2002 11:05 AM

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

All times are GMT -5. The time now is 12:13 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
Open Source Consulting | Domain Registration