Hi Mark-
That's a good question - distributed logging can be a difficult nut to
crack. Here's my two cents on the topic:
The driving factor is managability. If you have N servers, each
generating local logs, your application is not managable. In other words,
it becomes increasingly difficult to locate a log entry for a trouble
ticket the more servers you add into your system. This is not a positive
characteristic.
That being said, you need some form of distributed logging facility. RMI
would work well for you because each local system can remotely connect to
a central server and invoke a method like log(String message). Ultimately
every log message will reside on some media (disk or db) on the central
host. But what happens if that central host goes down?
I believe the best thing for you to do would be to log to a centralized
database (assuming you have a database in your application to begin with -
which may not be a valid assumption). Each node in your application
cluster logs directly to the database without consulting a central host.
This not only reduces network traffic, but more importantly eliminates a
network dependency on an application server running.
Sure, the nay-sayers out there may suggest that you're swapping one
negative for another (no application server running versus not database
running), but I'd argue that if an application server in your cluster
fails it's no big deal. If your entire database tier fails, you're out of
business until you get it running. That being said, depend on the DB to
be there, and make use of it for distributed and concurrent access.
Good luck,
-c
On Tue, 23 Sep 2003 21:24:52 -0700, Mark McKay wrote:
I've been reading 'Java RMI' from O'Reilly, and it provides a nice
example of scaling a server application by creating multiple instances
of server objects on several distinct machines (each running their own
JVM), and directing clients to the appropriate server through the naming
registry. However, it doesn't really get into how those servers might
talk to each other, except through similar calls through the registry.
For example, suppose I have a Logger class that in a non-RMI application
would be accessed as a singleton and write log requests to a log file.
A class would simply get a refrence to it via the static getInstance()
method and invoke it's other methods directly. Is there a way to get
similar functionality in an environment where I'm using several JVMs on
several machines all connected by a fast LAN? Or is it best to expose
this logger through the RMI registry as well?
Thanks
Mark McKay
--
http://www.kitfox.com