Hi,

On 18 March 2014 14:40, Daniel Mikusa <dmik...@gopivotal.com> wrote:

> On Mar 18, 2014, at 10:13 AM, Randeep <randeep...@gmail.com> wrote:
>
> > Hi,
> >
> > I have servers in Amazon Web Services Platform.
> >
> > My servers are Centos 5.4
> >
> > I have httpd-2.2+mod_jk+tomcat-6.0.37 stack on them
> >
> > I'm using elastic load balancer with autoscaling, so, many instances can
> > spawn and terminate anytime. But once the instance is terminated tomcat
> > logs of that instance is no more available.
> >
> > I was trying to forward httpd
>
> ErrorLog supports sending logs to syslog.
>
>   http://httpd.apache.org/docs/2.2/mod/core.html#errorlog
>
> I'm not sure about CustomLog.  That might take a little more work.  Are
> you trying to send access logs as well?
>
> > and Apache tomcat logs
>
> First thing that comes to mind here is using Log4j and it's syslog
> appender.
>
> You can setup Tomcat to use Log4j.  Instructions here.
>
>   http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j
>
> Then configure an appender to use SyslogAppender.
>
>
> http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/net/SyslogAppender.html
>
> That should get you anything that would normally be written to a Tomcat
> log (catalina.yyyy-mm-dd.log or localhost.yyyy-mm-dd.log).  It wouldn't get
> you access logs or anything your apps are writing to System.out /
> System.err.  Again, how much are you trying to send to your syslog server?
>

An alternative is to use Logback as it includes an access log filter for
Tomcat too
https://github.com/grgrzybek/tomcat-slf4j-logback

Note that you will have to configure Logback to write to Syslog (see
logback docs: http://logback.qos.ch/documentation.html), just as you would
for Log4J.

Depending upon the syslog implementation used in CentOS 5.4 you may want to
look at alternatives for improved performance / avoidance of dropped
messages etc. For example, you could use rsyslog or nsyslog

Brett

>
> Dan
>
> > to a central logging
> > server (splunk/graylog2). But was not able to.
> >
> >
> http://stackoverflow.com/questions/22293195/forwarding-logs-to-splunk-gralog-from-syslog-ng
> >
> > Has anyone done this? What is the best way to do it?
> >
> > Kindly advise.
> >
> > -- Randeep
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to