From: Ronny Schuetz on
On 01-Apr-10 08:15, J K wrote:

> [...]
> 2. Write logs into a database
> [...]
> 2 would provide a performance hit

You could log to a local file/database/queue first and send the log
entries asynchronously to the database. This would help if the DB isn't
available as well.

Ronny
From: markspace on
RedGrittyBrick wrote:

> My Java hat isn't firmly enough seated on my head - so the first things
> that popped into my mind were ...
>
> 1. Syslog


I was going to point out the same thing. Folks know that the syslogger
will automatically send logs (potentially ALL logs, if you want) to a
remote machine if you configure it to do so, right?

Typing "man syslog" into Google, I get the man page, there's a link to
syslog.conf, where I find:


"Remote Machine

This syslogd(8) provides full remote logging, i.e. is able to send
messages to a remote host running syslogd(8) and to receive messages
from remote hosts. The remote host won't forward the message again, it
will just log them locally. To forward messages to another host, prepend
the hostname with the at sign (''@'').

Using this feature you're able to control all syslog messages on one
host, if all other machines will log remotely to that. This tears down
administration needs. "

http://linux.die.net/man/5/syslog.conf

From: Tom Anderson on
On Thu, 1 Apr 2010, J K wrote:

> I work on a medium-to-large scale distributed web application. Often
> issues come up that need trouble shooting. Currently, sys-admins have
> to grep logs on as many as 100 machines to find useful information. Of
> course this can be done via bash, but that is slow and error prone. I
> would like to implement an easier way.

Bashreduce!

http://blog.last.fm/2009/04/06/mapreduce-bash-script

tom

--
Damn the Solar System. Bad light; planets too distant; pestered with
comets; feeble contrivance; could make a better myself. -- Francis Jeffery
From: Arne Vajhøj on
On 01-04-2010 02:15, J K wrote:
> Hey guys,
>
> I work on a medium-to-large scale distributed web application. Often issues come up that need trouble shooting. Currently, sys-admins have to grep logs on as many as 100 machines to find useful information. Of course this can be done via bash, but that is slow and error prone. I would like to implement an easier way.
>
> It seems that there are three options:
>
> 1. Write logs over the network to some "central" location.
> 2. Write logs into a database
> 3. Develop some remote search capability to search or index all the logs
>
> 1 seems okay but there would have to be redundancy in that "central" location
> 2 would provide a performance hit
> 3 seems like the best, but the indexing capability may be complicated.
>
> Does anyone know of any libraries that fit into 1, 2, or 3 (we use log4j, so compatibility would be nice).
>
> I'd love to hear about how others have addressed this issue.
>
> Anyway, love to hear thoughts on this!

log4j seems fine for that.

You just need to pick an appender that fits with #1 or #2.

RollingFileAppender to NFS share
SyslogAppender
JDBCAppender
etc.

Arne