permaculture playing cards*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI server logging problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI server logging problem" Watch "RMI server logging problem" New topic
Author

RMI server logging problem

Ronald Wouters
Ranch Hand

Joined: Apr 28, 2005
Posts: 190
Hi all,

when I start my server using loglevel finer for example, not only do I get my own logging of the URLyBird application, I also see all the internal workings of RMI like creating TCP endpoints, bindings being made to the registry etc...
Although thats great for debugging, I would like to be able to stop the internal RMI logging sometimes because it is crowding the logs an making things unclear.
I thought that the server property "java.rmi.server.logCalls" would help but the default value for that is already false.

So, is there any way I could get just my own loggings and not also the internal RMI stuff ?

Regards,
Ronald Wouters



Sun Certified Developer for the Java 2 Platform
Sun Certified Enterprise Architect for the Java Platform, Enterprise Edition 5
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11465
    
  94

Hi Ronald,

Can you just turn off logging for the java.rmi and javax.rmi packages?

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Ronald Wouters
Ranch Hand

Joined: Apr 28, 2005
Posts: 190
Hi Andrew,

thanks for your suggestion. However, I am not sure that would do any good. Look at the following:

As you can see the logging apparently comes from some private packages from Sun itself and not from the core java.rmi and javax.rmi packages. Don't know if I can access those ... decompiling maybe

By the way how exactly would you go about switching off logging for a given package like "java.rmi" anyway ?
The way I understand it is that when you say Logger.getLogger("java.rmi") the only real requirement according to the api docs is that the string you pass into getLogger "should be a dot-separated name" needed to create hierarchical logging "namespaces". Using package names like "java.rmi" or "suncertify.db" is merely a suggestion. I could just as easily say getLogger("ronald") and getLogger("ronald.wouters") and still have a valid hierarchical logging namespace structure, right ?

Regards,
Ronald Wouters
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11465
    
  94

Hi Ronald,

That's true, however if Sun are following their own recommended practices, then they should be naming their loggers in the standard way, so turning off logging for any sun packages should still work.

Regards, Andrew
Ronald Wouters
Ranch Hand

Joined: Apr 28, 2005
Posts: 190
Hi Andrew,

I got it ! The following piece of code did the trick:

As you can see I needed to switch of logging for the sun.rmi package.
Apparently Sun is following its own recommendations at least as far as logging is concerned.

Thanks for the help.

Regards,
Ronald
[ February 03, 2006: Message edited by: Ronald Wouters ]
 
GeeCON Prague 2014
 
subject: RMI server logging problem