> # Overwrite the file each time > log4j.appender.File.append=false
> # Print the date in ISO 8601 format > log4j.appender.File.layout.ConversionPattern=%d %-5p (%c{1}): %m%n
> log4j.logger.org.clapper.curn=info
> set > CURN_JAVA_VM_ARGS=-Dlog4j.configuration="file://d:/curn-3.2.6/docs/users-gu ide/log4j.properties"
> When I started the curn using curn --logging yahoo.cfg, Log4j hadn't > been used . Instead, java.util.Logging was used .
> Any suggestion ?
Yes. Curn uses Apache Commons Logging. Thus, you must also tell Commons Logging what logging framework to use; otherwise, it defaults to java.util.Logging. The Users' Guide is not specific enough here; I will update it. In any case, you also need this option, to use Log4J:
-Dorg.apache.commons.logging.log=org.apache.commons.logging.impl.Log4JLogge r -- -Brian
I am sorry to say that the reason curn ignore log4j is that I forgot adding the log4j dependency to %CURN_HOME%/lib
But after I did that and followed your instruction, an exception occurred:
log4j:ERROR Could not read configuration file from URL [file://D:/curn-3.2.6/doc s/users-guide/log4j.properties]. java.net.UnknownHostException: D at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.NetworkClient.openServer(Unknown Source) at sun.net.ftp.FtpClient.openServer(Unknown Source) at sun.net.ftp.FtpClient.openServer(Unknown Source) at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source) at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Sour ce) at java.net.URL.openStream(Unknown Source) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurato r.java:459) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionCon verter.java:471) at org.apache.log4j.LogManager.<clinit>(LogManager.java:125) at org.apache.log4j.Logger.getLogger(Logger.java:105) at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.jav a:283) at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:1 08) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou rce) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(Log FactoryImpl.java:1040) at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementat ion(LogFactoryImpl.java:782) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory Impl.java:601) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory Impl.java:333) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:664) at org.clapper.util.logging.Logger.enableLogger(Logger.java:606) at org.clapper.util.logging.Logger.enableLogging(Logger.java:294) at org.clapper.util.cmdline.CommandLineUtility$1.parseOption(CommandLine Utility.java:984) at org.clapper.util.cmdline.ParameterParser.parse(ParameterParser.java:3 29) at org.clapper.util.cmdline.CommandLineUtility.parseParams(CommandLineUt ility.java:1001) at org.clapper.util.cmdline.CommandLineUtility.execute(CommandLineUtilit y.java:222) at org.clapper.curn.Tool.main(Tool.java:170) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.clapper.curn.Bootstrap.loadAndRun(Bootstrap.java:340) at org.clapper.curn.Bootstrap.main(Bootstrap.java:203) log4j:ERROR Ignoring configuration file [file://D:/curn-3.2.6/docs/users-guide/l og4j.properties]. log4j:WARN No appenders could be found for logger ( org.clapper.util.classutil.Cl assFinder). log4j:WARN Please initialize the log4j system properly.
>> When I started the curn using curn --logging yahoo.cfg, Log4j hadn't >> been used . Instead, java.util.Logging was used .
>> Any suggestion ?
> Yes. Curn uses Apache Commons Logging. Thus, you must also tell Commons > Logging what logging framework to use; otherwise, it defaults to > java.util.Logging. The Users' Guide is not specific enough here; I will > update it. In any case, you also need this option, to use Log4J:
> -Dorg.apache.commons.logging.log=org.apache.commons.logging.impl.Log4JLogge r > -- > -Brian
> -- > You received this message because you are subscribed to the "curn-users" > group. > To post to this group, send email to curn-users@googlegroups.com > To unsubscribe from this group, send email to > curn-users+unsubscribe@googlegroups.com<curn-users%2Bunsubscribe@googlegrou ps.com> > For more options, visit this group at > http://groups.google.com/group/curn-users?hl=en
> I am sorry to say that the reason curn ignore log4j is that I forgot > adding the log4j dependency to %CURN_HOME%/lib
> But after I did that and followed your instruction, an exception occurred:
> log4j:ERROR Could not read configuration file from URL > [file://D:/curn-3.2.6/doc > s/users-guide/log4j.properties]. > java.net.UnknownHostException: D
i.e., one slash before the "D:", not two. -- -Brian
Brian Clapper, http://www.clapper.org/bmc/ If you think the United States has stood still, who built the largest shopping center in the world? -- Richard M. Nixon
On Fri, Sep 24, 2010 at 2:54 AM, Brian Clapper <b...@clapper.org> wrote: > On 09/23/2010 02:21 PM, Liu Yongjian wrote:
>> I am sorry to say that the reason curn ignore log4j is that I forgot >> adding the log4j dependency to %CURN_HOME%/lib
>> But after I did that and followed your instruction, an exception occurred:
>> log4j:ERROR Could not read configuration file from URL >> [file://D:/curn-3.2.6/doc >> s/users-guide/log4j.properties]. >> java.net.UnknownHostException: D
> Your file-based URL is unparsable by the JDK. Try
> Brian Clapper, http://www.clapper.org/bmc/ > If you think the United States has stood still, who built the largest > shopping center in the world? > -- Richard M. Nixon
> -- > You received this message because you are subscribed to the "curn-users" > group. > To post to this group, send email to curn-users@googlegroups.com > To unsubscribe from this group, send email to > curn-users+unsubscribe@googlegroups.com<curn-users%2Bunsubscribe@googlegrou ps.com> > For more options, visit this group at > http://groups.google.com/group/curn-users?hl=en
org.clapper.util.cmdline.CommandLineException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable. at org.clapper.util.cmdline.CommandLineUtility.execute(CommandLineUtility.java :239) at org.clapper.curn.Tool.main(Tool.java:160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:5 7) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp l.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.clapper.curn.Bootstrap.loadAndRun(Bootstrap.java:330) at org.clapper.curn.Bootstrap.main(Bootstrap.java:193) Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable. at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(Lo gFactoryImpl.java:798) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.j ava:601) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.j ava:333) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:664) at org.clapper.util.logging.Logger.enableLogger(Logger.java:606) at org.clapper.util.logging.Logger.enableLogging(Logger.java:294) at org.clapper.util.cmdline.CommandLineUtility$1.parseOption(CommandLineUtilit y.java:984) at org.clapper.util.cmdline.ParameterParser.parse(ParameterParser.java:329) at org.clapper.util.cmdline.CommandLineUtility.parseParams(CommandLineUtility. java:1001) at org.clapper.util.cmdline.CommandLineUtility.execute(CommandLineUtility.java :222) ... 7 more
On Fri, Sep 24, 2010 at 3:02 AM, Liu Yongjian <ggd...@gmail.com> wrote: > It's working , Thanks Brian
> On Fri, Sep 24, 2010 at 2:54 AM, Brian Clapper <b...@clapper.org> wrote:
>> On 09/23/2010 02:21 PM, Liu Yongjian wrote:
>>> I am sorry to say that the reason curn ignore log4j is that I forgot >>> adding the log4j dependency to %CURN_HOME%/lib
>>> But after I did that and followed your instruction, an exception >>> occurred:
>>> log4j:ERROR Could not read configuration file from URL >>> [file://D:/curn-3.2.6/doc >>> s/users-guide/log4j.properties]. >>> java.net.UnknownHostException: D
>> Your file-based URL is unparsable by the JDK. Try
>> Brian Clapper, http://www.clapper.org/bmc/ >> If you think the United States has stood still, who built the largest >> shopping center in the world? >> -- Richard M. Nixon
>> -- >> You received this message because you are subscribed to the "curn-users" >> group. >> To post to this group, send email to curn-users@googlegroups.com >> To unsubscribe from this group, send email to >> curn-users+unsubscribe@googlegroups.com<curn-users%2Bunsubscribe@googlegrou ps.com> >> For more options, visit this group at >> http://groups.google.com/group/curn-users?hl=en
> org.clapper.util.cmdline.CommandLineException: User-specified log class > 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not > useable. > at > org.clapper.util.cmdline.CommandLineUtility.execute(CommandLineUtility.java :239) > at org.clapper.curn.Tool.main(Tool.java:160) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:5 7) > at
This is likely to be a classpath issue. Is the Log4J jar file in one of the lib directories, as described here?
Brian Clapper, http://www.clapper.org/bmc/ How does a project get to be a year late? ... One day at a time. -- Frederick Brooks, Jr., The Mythical Man Month
On Fri, Sep 24, 2010 at 3:08 AM, Brian Clapper <b...@clapper.org> wrote: > On 09/23/2010 03:02 PM, Liu Yongjian wrote:
>> It's working , Thanks Brian
> ;-)
> -- > -Brian
> Brian Clapper, http://www.clapper.org/bmc/ > Main's Law: For every action there is an equal and opposite government > program.
> -- > You received this message because you are subscribed to the "curn-users" > group. > To post to this group, send email to curn-users@googlegroups.com > To unsubscribe from this group, send email to > curn-users+unsubscribe@googlegroups.com<curn-users%2Bunsubscribe@googlegrou ps.com> > For more options, visit this group at > http://groups.google.com/group/curn-users?hl=en
On Fri, Sep 24, 2010 at 3:11 AM, Liu Yongjian <ggd...@gmail.com> wrote: > ..... > What is the matter ?
> On Fri, Sep 24, 2010 at 3:08 AM, Brian Clapper <b...@clapper.org> wrote:
>> On 09/23/2010 03:02 PM, Liu Yongjian wrote:
>>> It's working , Thanks Brian
>> ;-)
>> -- >> -Brian
>> Brian Clapper, http://www.clapper.org/bmc/ >> Main's Law: For every action there is an equal and opposite government >> program.
>> -- >> You received this message because you are subscribed to the "curn-users" >> group. >> To post to this group, send email to curn-users@googlegroups.com >> To unsubscribe from this group, send email to >> curn-users+unsubscribe@googlegroups.com<curn-users%2Bunsubscribe@googlegrou ps.com> >> For more options, visit this group at >> http://groups.google.com/group/curn-users?hl=en