Re: Concurrent, persistent background process for a J2EE container
Donkey Hottie wrote:
Mark Space <markspace@sbcglobal.net> wrote in
news:g99hco$v60$1@registered.motzarella.org:
Donkey Hottie wrote:
We can't use java.util.logging for this. Boss wants "structured"
data, not flat text files.
So you know about XMLFormatter for logging, right? I'm curious: why
doesn't that work?
Nope. But you got me interested! Like I said, I'm no guru in Java EE.
java.util.logging.XMLFormatter is a regular old Java class, nothing to
do directly with Java EE really. Other than Java EE uses the regular
old Java API.
Socket? But there always has to be an another thread or process in the
other end of the socket, no?
Socket programming is nothing new to me, 20+ years with C++ but J2EE
practices are new to me.
Well I'm speaking mostly from general network programming experience
myself. I don't admin systems, but I know from monkeying around with my
own boxes that real OSs (Unix) have supported logging through sockets
for a long time. It's a standard configuration parameter on all Unix
loggers, and I think now for Windows too.
But the standard process to read the logs wouldn't do anything special
with them, just write them to disk. If the text is already XML
formatted that might be enough. But there's likely to be delays and
such, so this might not update instantly for you web interface.
It seems reasonable that someone may have written a utility to read
standard logs from a socket and stuff them in a database, but I don't
happen to know any such utilities.
What I think I'm trying to say is that Java EE fundamentally isn't
different from other types of programming, and you should eschew
re-inventing the wheel, just like regular old programming. Writing text
to a buffer (even XML formatted) is simple, fast, obviates the need for
complex multithreading schemes, and all around seems simpler to me. But
yes of course someone has to read the socket on the other end.
But you know your requirements best, and there seems to already an
expectation that systems actually write some of their logs to a database
to gain other features.