|
From: Leif M. <le...@ta...> - 2004-03-14 17:04:51
|
Jennifer,
It is currently possible to send log messages to the Wrapper at any
log level my
using the WrapperManager.log(level, message) method. This sends the
messages
across the socket so it is not appropriate for high volumes of
messages. It works
great for the occasional event log message however.
I have been looking at ways of making it efficient to send messages
at various
log levels off through the stderr/stdout streams. It involves
intercepting all console
output (possible) and then modifying each line so it starts with a log
level code.
The Wrapper process would then parse these codes to decide what level at
which
to log the messages. It should be pretty light weight as well.. Still
needs to put to
code though. There are a few gotchas with this that I am still trying
to work out in
my head however.
As for using commons logging. I am strongly against that. Not that
there is
anything wrong with it. But I want to maintain the 0 dependency nature
of the
Java Service Wrapper. That is one of the things that makes it so useful.
Personally I use the Apache Avalon LogKit logger for a number of reasons.
Everyone has their own personal preference.
Once I get the ability to log console output at different log levels
working. The
next logical step would be to provide a method for Commons logging,
logkit etc
to hook into the Wrapper logging system and use it as a log target,
rather than
the other way around.
Let me know if you have any suggestions.
Cheers,
Leif
Jennifer Kolar wrote:
> My request is to either use commons-logging throughout your app--
> since you have essentially created your own implementation of it--
> and allow through the inner spawned applications commons-logging
> messages at their relative levels (rather than only wrapping them all
> in info)..
>
> or leave your implementation as is, but still allow through the
> spawned applications commons-logging messages at their levels rather
> than putting everything in info.
>
> Where this is a real problem for me is the event logging. I can't send
> any of my application errors to the event log - using your code as is-
> unless I enable info .. which is way more verbose than I want to send
> to the log..
>
> not sure if you have thought about doing this already or not, I know
> you recently reworked how you pass through stdout..
> If you have thought about it-- what implementation plan did you have
> that I could perhaps follow early?
>
> I know you capture all std out from the calling app-- so maybe you
> would have to filter each message looking for commons logging
> levels and map those to the appropriate level in your app.. if you
> didn't think it reasonable to just use commons-logging wholesale. Just
> one thought...
>
> thanks
> Jennifer
|