LinuxQuestions.org
Visit Jeremy's Blog.
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-15-2009, 05:28 PM   #1
ddenton
Member
 
Registered: May 2007
Posts: 114

Rep: Reputation: 15
Write Apache Error Log to Local File and Syslog Server


Hello all.

I have an apache 2 webserver running on RHEL4. I'd like to log to both my syslog server AND the local error log. My results though have been mixed and I'm wondering if anyone else has this problem or has worked around it.

When I use the following directives in the following order, the syslog server receives error log entries just fine, but the local file isn't written to.

Code:
ErrorLog /logs/apache/error_log
ErrorLog syslog:local5
When I switch them around, it works, but not fully. Error and Notice level entries go to the local file, while Warn level entries go to the syslog server.

Can anyone shed some light on why the output seems to be split between the destinations instead of being sent to both?

Thanks,

Dan
 
Old 10-15-2009, 09:23 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,817

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
That's because Apache takes the last definition for a given param. You can log locally & remotely using the link in my post #5 here http://www.linuxquestions.org/questi...ghlight=syslog
 
Old 10-16-2009, 09:32 AM   #3
ddenton
Member
 
Registered: May 2007
Posts: 114

Original Poster
Rep: Reputation: 15
Thanks Chrism for the reply. I realized after seeing your post that I was trying to do things in the wrong order. Instead of relying on apache to write to multiple locations, I needed to log everything to syslog and let the syslog daemon do the work of sending the traffic to multiple locations.

Thanks again...
 
  


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
In Apache server, How to change log file location and log format for access log fil? since1993 Linux - Server 1 08-19-2009 05:14 PM
getting syslog to write to other file than /var/log/messages c_mitulescu Linux - Enterprise 6 04-02-2008 11:17 AM
Apache 2.2 error log stating file doesnt exist, when it clearly does. sarina1975 Linux - General 5 08-20-2006 06:56 PM
Write Error Log to Text File jamez15 Linux - General 3 07-02-2006 08:32 PM
write to syslog during boot and rc.local turnbui Linux - Newbie 8 07-29-2005 02:30 PM

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

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