Proxool uses a logging strategy based on Jakarta Commons Logging:
http://proxool.sourceforge.net/logging.html
http://jakarta.apache.org/commons/logging.html
Commons logging will try to figure out automatically what log system to use. If the Log4J library is available it will be chosen, then if JDK 1.4 is available it will be chosen.
You need to do two things:
1) Configure JDK 1.4 logging globally
This can be done through the LogManager (http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/LogManager.html), for instance by loading configuration properties from a file using the readConfiguration(InputStream ins) method.
2) Make sure that JDK 1.4 logging is chosen in favour of Log4J.
You don't have to do anything if Log4J is not available in the classpath of your app.
If Log4J is available you will have to explicitely tell Proxool to use a JDK 1.4 logger.
You do this by setting this property:
org.logicalcobwebs.logging.Log=org.logicalcobwebs.logging.impl.Jdk14Logger
You can set it as a system property
Commandline:
java -Dorg.logicalcobwebs.logging.Log=org.logicalcobwebs.logging.impl.Jdk14Logger
Programatically:
System.setProperty("org.logicalcobwebs.logging.Log", "org.logicalcobwebs.logging.impl.Jdk14Logger");
...or you can set it directly on Proxools LogFactory:
org.logicalcobwebs.logging.LogFactory.getFactory().setAttribute("org.logicalcobwebs.logging.Log", "org.logicalcobwebs.logging.impl.Jdk14Logger")
CHR
----- Original Message -----
From: "Cochran, Keith" <Kei...@tr...>
Date: Mon, 6 Oct 2003 15:55:14 -0600
To: "''pro...@li...''" <pro...@li...>
Subject: [Proxool-developer] Logging in Java 1.4
> Do you have any examples of how to log Proxool using the
> 1.4 style of logging. I know how to set up logging and use it
> in 1.4, but how do I get the logging info out of Proxool to
> go to it's own logger?
> -----------------------------------------
> If I set up a logger as such:
>
> Logger logger = Logger.getLogger("com.my.logger");
> FileHandler handler = new FileHandler("logFilename_%g.log", 1000000, 10,
> false);
> handler.setFormatter(new SimpleFormatter());
> Logger logger.addHandler(handler);
> logger.setLevel(Level.FINE);
> logger.logp(Level.WARNING, "MyClass", "main", "Some Warning message");
>
> ...this prints out a warning message to my log file no problem.
>
> How do I get the Proxool messages to go to a logger instead of stdout?
>
> Thanks!
> -Keith
>
> _______________________________________________
> Keith G. Cochran
> New Technology Development - The TriZetto Group, Inc.
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Proxool-developer mailing list
> Pro...@li...
> https://lists.sourceforge.net/lists/listinfo/proxool-developer
--
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
|