saadwharton
Programmer
Hi,
I am running Apache 2 on Ubuntu. I am trying to send 'File Does not exist' messages from Apache to syslog-ng on the same server.
I have the following perl script. The perl script is named apachelogger and is saved in the / directory.
#!/usr/bin/perl
Use Sys::Syslog qw( EFAULT setlogsock );
Setlogsock(‘unix’);
Openlog(‘apache’, ‘cons’, ‘pid’ ‘local2’);
While &log = <STDIN>) {
Syslog(‘notice’, $log);
}
closelog
My /etc/apache2/apache2.conf has the line:
ErrorLog |/apachelogger
The only Apache messages I see in /var/log/syslog pertain to the starting and stopping of Tomcat and JSvc.exe as well as SIGTERM messages. I don't see any 'File Does Not Exist' messages when I enter the url of an unexisting file in a browser. I am using lynx (on the same server) to test this and I enter URL requests such as where test3.html does not exist in /var/www/ . The 'File Does not exist' messages show up in the apache error.log file. What am I doing wrong above?
I have also tried this by simply adding
ErrorLog syslog:local1
Same result as above. Please help.
Thanks.
I am running Apache 2 on Ubuntu. I am trying to send 'File Does not exist' messages from Apache to syslog-ng on the same server.
I have the following perl script. The perl script is named apachelogger and is saved in the / directory.
#!/usr/bin/perl
Use Sys::Syslog qw( EFAULT setlogsock );
Setlogsock(‘unix’);
Openlog(‘apache’, ‘cons’, ‘pid’ ‘local2’);
While &log = <STDIN>) {
Syslog(‘notice’, $log);
}
closelog
My /etc/apache2/apache2.conf has the line:
ErrorLog |/apachelogger
The only Apache messages I see in /var/log/syslog pertain to the starting and stopping of Tomcat and JSvc.exe as well as SIGTERM messages. I don't see any 'File Does Not Exist' messages when I enter the url of an unexisting file in a browser. I am using lynx (on the same server) to test this and I enter URL requests such as where test3.html does not exist in /var/www/ . The 'File Does not exist' messages show up in the apache error.log file. What am I doing wrong above?
I have also tried this by simply adding
ErrorLog syslog:local1
Same result as above. Please help.
Thanks.