Login | Register
My pages Projects Community openCollabNet

Discussions > dev > [maxq-dev] Re: [maxq-cvs] CVS update: /maxq/java/com/bitmechanic/maxq/

maxq
Discussion topic

Back to topic list

[maxq-dev] Re: [maxq-cvs] CVS update: /maxq/java/com/bitmechanic/maxq/

Author Oliver Bock <oliverbock at switfdsl dot com dot au>
Full name Oliver Bock <oliverbock at switfdsl dot com dot au>
Date 2004-09-15 18:03:52 PDT
Message Hari,

But we don't run log4j. As it is distributed, maxq uses the default
Jdk14Logger, which is a wrapper around java.util.logging.Logger.
Java.util.logging.Logger is not configurable via a properties file.

I do not think it would be worthwhile to include log4j with maxq
distributions because I think the logger built into JDK 1.4 is
sufficient for our needs. Instead I suggest we should use the -d flag
to set the logging level, and convert existing code of the form:

  if (Config.isDebug()) { System.err.println("something or other"); }

to:

  log.debug("something or other");

What do you think?


    Oliver

--
On 16/09/2004, at 10:36, hdara at primavera dot com wrote:
> I think the right location for this change is the
> conf/log4j.properties.
> The conf directory I think is already there in the classpath, so should
> get picked up. This approach should give a better control for the user
> if
> they ever want to set it to INFO or even DEBUG.
>
> Thanks,
> Hari
>
> oliverbock at tigris dot org wrote on 09/15/2004 05:24:16 PM:
>
>> User: oliverbock
>> Date: 04/09/15 17:24:16
>>
>> Modified:
>> /maxq/java/com/bitme​chanic/maxq/
>> Main.java
>>
>> Log:
>> Disabled annoying INFO log messages about redirections. They came
>> from HttpClient.
>>
>> File Changes:
>>
>> Directory: /maxq/java/com/bitme​chanic/maxq/
>> ====================​====================​===
>>
>> File [changed]: Main.java
>> Url: http://maxq.tigris.
>>
> org/source/browse/ma​xq/java/com/bitmecha​nic/maxq/Main.java?
> r1=1.12&r2=1.13
>> Delta lines: +12 -0
>> --------------------
>> --- Main.java 15 Sep 2004 01:40:10 -0000 1.12
>> +++ Main.java 16 Sep 2004 00:24:15 -0000 1.13
>> @@ -7,6 +7,7 @@
>> import java.util.HashMap;
>> import java.util.Iterator;
>> import java.util.Properties;
>> +import java.util.logging.Level;
>>
>> import org.python.util.Pyth​onInterpreter;
>> import org.apache.commons.c​li.CommandLine;
>> @@ -16,6 +17,9 @@
>> import org.apache.commons.cli.Options;
>> import org.apache.commons.c​li.PosixParser;
>> import org.apache.commons.c​li.ParseException;
>> +import org.apache.commons.logging.Log;
>> +import org.apache.commons.l​ogging.LogFactory;
>> +import org.apache.commons.l​ogging.impl.Jdk14Log​ger;
>>
>>
>> public class Main {
>> @@ -104,6 +108,14 @@
>>
>> public static void main(String[] argv) {
>> try {
>> + // Disable anoying INFO messages from Apache HttpClient.
>> + Log log = LogFactory.getLog("o​rg.apache.commons");​
>> + ((Jdk14Logger)log).g​etLogger().setLevel(​Level.WARNING);
>> +
>> + // An alternative way to achieve the above.
>> + //System.setProperty​("org.apache.commons​.logging.Log",
>> "org.apache.commons.​logging.impl.SimpleL​og");
>> + //System.setProperty​("org.apache.commons​.logging.
>> simplelog.defaultlog", "warn");
>> +
>> parseLine(argv);
>>
>> Main m = new Main();
>>
>>
>>
>


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: dev-unsubscribe at maxq dot tigris dot org
For additional commands, e-mail: dev-help at maxq dot tigris dot org

« Previous message in topic | 1 of 3 | Next message in topic »

Messages

Show all messages in topic

[maxq-dev] Re: [maxq-cvs] CVS update: /maxq/java/com/bitmechanic/maxq/ Oliver Bock <oliverbock at switfdsl dot com dot au> Oliver Bock <oliverbock at switfdsl dot com dot au> 2004-09-15 18:03:52 PDT
     Re: [maxq-dev] Re: [maxq-cvs] CVS update: /maxq/java/com/bitmechanic/maxq/ hdara at primavera dot com hdara at primavera dot com 2004-09-16 10:11:47 PDT
         Re: [maxq-dev] Logging levels (was: CVS update: /maxq/java/com/bitmechanic/maxq/) Oliver Bock <oliverbock at swiftdsl dot com dot au> Oliver Bock <oliverbock at swiftdsl dot com dot au> 2004-09-16 21:54:45 PDT
Messages per page: