Re: centralized logging for Rio and Jini services

"Johnson, Brad" <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Calum,

Thanks, that helps, it is clearer now. Let me give it another try. It is
taking some time for the Jini way of doing things to sink in. Too much
AJAX, J2EE, Web based architecture in my head. 

Don't worry about the config file setting for PublishingLevel. Since I
need to add code to lookup the Eros service into my code anyway one line
of code is not going to hurt.

I was thinking I might write my own logger that is like the
java.util.logging.SocketHandler. But instead of it sending the log over
a socket it would lookup a logging service or put the log into a
JavaSpace for a log reader to grab off. That way I could just change the
logging params in the Rio opstring or logging.properties in the case of
a plain Jini service. Of course I would need to make sure that the
JiniLogHandler was already installed on the node. 

Wait a minute, I remember this idea from somewhere . ..  Greg Wonderly
http://www.artima.com/weblogs/viewpost.jsp?thread=86151
And here
http://archives.java.sun.com/cgi-bin/wa?A2=ind0501&L=jini-users&P=15308

And Dennis Reedy here
http://www.sun.com/software/jini/whitepapers/rio_architecture_overview.p
df

-----Original Message-----
From: Calum Shaw-Mackay [mailto:[email protected]] 
Sent: Thursday, March 08, 2007 3:45 PM
To: [email protected]
Subject: Re: centralized logging for Rio and Jini services

On 08/03/07, Johnson, Brad <[email protected]> wrote:
> Calum,
>
> Thanks for the help.
>
> Is there a way to set eros up so that it can be integrated in the 
> logging.properties file. Rio sends its logs out using the 
> java.util.logger handlers. I currently can setup a FileHandler, 
> ConsoleHandler and SocketHandler in the logging.properties and in the 
> Rio opstring config file and it works. At the moment I am able to see 
> the log messages from all of my Jini servers in Chainsaw coming over 
> the java.util.logging.SocketHandler.

Not really, because you have to lookup the Eros Service in order to have
the Logging handler supplied to you, hence you can't (or at least I
don't think you can) put it in the logging.properties file. Although I
could have a look at it a bit deeper and try and think of some work
around

>
> Can I just use the ErosHandler instead of the SocketHandler? (or do I 
> use the ErosHandlerImpl?)

Again this is because this logging handler is downloaded remotely, after
the JVM has been started and probably after loggin.properties file has
been parsed and initialised

I am trying this now but I don't think my Rio
> service is sending any warning or severe messages. Is there a 
> parameter I can set for PublishingLevel in a configuraion file instead

> of setting it in the code?

I'll look into it.

> Do I need an instance of Eros service running on each machine I have 
> Jini on?

No, all you really need is 1 eros instance, but you have to do a service
lookup for each service/client you want to use Eros logging in.

> The eros setup page has the following code. Do I need this to be in 
> each of my Jini services? I tried to use it but I am having trouble 
> with config.getEntry. I am not even to the point of compiling it 
> because what object config refers to. Forgive my ignorance. Is this 
> reading the eros.config file or is it some sort of Jini object?

Okay the source refres to some form of Prxy perparer done by your
service (part of Jini's security framework) - you don't actually need
this. you would just change this line

             eros = (ErosService) preparer.prepareProxy(svc.service);
to
             eros = (ErosService) svc.service;

I am working on allowing you to have differnet application labels logged
on a single logger depending on which logger (package name) you're
using, which helps for things like containers, etc. To be honest I'll
probably put a lot of that boilerplate code into some form of Utility
class once I get 5 spare mins.

Hope this helps

--Calum

------------------------------------------------------------------------
--
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:
http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to
[email protected]

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.