[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [xmlblaster] Client startup and logging



Update:

I've been able to divert the normal xmlBlaster logging to my own logging
facility by making my own I_LogDeviceFactory.  However, there are still
a couple of messages sent to System.out (apparently from within jutils)
that I couldn't suppress, so I "brute force" suppress them by
temporarily re-routing System.out.  Here's my code:

        ByteArrayOutputStream os = new ByteArrayOutputStream();
        PrintStream tempOut = new PrintStream(os);
        PrintStream origOut = System.out;
        System.setOut(tempOut);

        String[] args = new String[2];
        args[0] = "-LoggableDevicePlugin[console][1.0]";
        args[1] =
"com.a4networks.server.connection.xmlblaster.PRLoggingFactory";

        Global global = new Global(args, true, false);

        System.setOut(origOut);

Also, this only works when I set the loadPropFile on the Global
constructor to true.  If I set it to false, all the logging from the
xmlBlaster client code goes to System.out.

I'm still seeing messages on System.out from JACORB.  Does anyone know
how I can suppress/re-route these?

-----Original Message-----
From: David Hooker 
Sent: Tuesday, April 01, 2003 4:00 PM
To: xmlblaster at server.xmlblaster.org
Subject: [xmlblaster] Client startup and logging


Hi all-

In my program, I've added the ability for it to subscribe to xmlBlaster.
What I haven't figured out yet is how to control the client-side
startup.  I want to be able to set several properties from my code for
the xmlBlaster client before it starts.  

One reason is that I want to capture all the logging and divert it into
my own log files.  I've figured out the I_LogDeviceFactory and
associated classes, but I don't want to have to have a properties *file*
in order to use it.  So where can I programaticaly set my logger to be
the ONLY log device used?


Another thing I noticed is that when I *do* use the properties file to
log to a file, like this:

 
LoggableDevicePlugin[file][1.0]=org.xmlBlaster.util.log.FileLogDeviceFac
tory,logFile=xmlb.log
   logDevice=file

... WARN messages are still printed to the console, even though I don't
have a console log device.  Why is this?  How can I turn that off?