You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Becker, Thomas, VF-Group" <Th...@vodafone.com> on 2006/02/22 12:12:35 UTC

AccessLogValve - tomcat 5.0.x logging to syslog?!

Hi everybody,

I've searched the internet and experimented around getting the following
done:

I want to have tomcat logging it's access log to syslog.

I already successfully have catalina.out and all the server's logs
written through log4j, which makes logging to syslog quite easy.
Only the AccessLogValve is causing me headaches. I don't have any idea
anymore on how to get it logged through l4j or directly to syslog.

Thanks a lot!
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: AccessLogValve - tomcat 5.0.x logging to syslog?!

Posted by Tim Funk <fu...@joedog.org>.
You'd need to implement your own access log valve class to write to syslog. 
OR if you are using a Unix system you *might* be able to try this kludge:

1) Create a named pipe (using mkfifo)
2) Configure AccessLogValve to NOT rotate and use that named pipe
3) Run a program which reads from the fifo and writes to syslog, for example, 
this tiny perl script:

---
use Sys::Syslog;
open(FIFO, "$myFifoFile") ||die "this won't be pretty, $!";
while(<FIFO>) {
    system('logger', '-t', 'tomcat', '-p', 'local3.info', $_);
}
close(FIFO);
---


-Tim

Becker, Thomas, VF-Group wrote:
> Hi everybody,
> 
> I've searched the internet and experimented around getting the following
> done:
> 
> I want to have tomcat logging it's access log to syslog.
> 
> I already successfully have catalina.out and all the server's logs
> written through log4j, which makes logging to syslog quite easy.
> Only the AccessLogValve is causing me headaches. I don't have any idea
> anymore on how to get it logged through l4j or directly to syslog.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org