Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Can not use Log4j on Windows
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Liu Yongjian  
View profile  
 More options Sep 23 2010, 12:49 pm
From: Liu Yongjian <ggd...@gmail.com>
Date: Fri, 24 Sep 2010 00:49:48 +0800
Local: Thurs, Sep 23 2010 12:49 pm
Subject: Can not use Log4j on Windows

I have configure the log4j.properties and set the environment variable
CURN_JAVA_VM_ARGS properly according to the user manual

// Located on file://d:/curn-3.2.6/docs/users-guide/log4j.properties
log4j.rootLogger=info, File,CONSOLE

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.SimpleLayout

log4j.appender.File=org.apache.log4j.FileAppender
log4j.appender.File.layout=org.apache.log4j.PatternLayout

log4j.appender.File.file=log.out

# 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 ?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Clapper  
View profile  
 More options Sep 23 2010, 1:56 pm
From: Brian Clapper <b...@clapper.org>
Date: Thu, 23 Sep 2010 13:56:52 -0400
Local: Thurs, Sep 23 2010 1:56 pm
Subject: Re: [curn-users] Can not use Log4j on Windows
On 09/23/2010 12:49 PM, Liu Yongjian wrote:

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

Brian Clapper, http://www.clapper.org/bmc/
A man shall never be enriched by envy.
        -- Thomas Draxe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Liu Yongjian  
View profile  
 More options Sep 23 2010, 2:21 pm
From: Liu Yongjian <ggd...@gmail.com>
Date: Fri, 24 Sep 2010 02:21:21 +0800
Local: Thurs, Sep 23 2010 2:21 pm
Subject: Re: [curn-users] Can not use Log4j on Windows

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Clapper  
View profile  
 More options Sep 23 2010, 2:54 pm
From: Brian Clapper <b...@clapper.org>
Date: Thu, 23 Sep 2010 14:54:34 -0400
Local: Thurs, Sep 23 2010 2:54 pm
Subject: Re: [curn-users] Can not use Log4j on Windows
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

    file:/D:/curn-3.2.6/docs/users-guide/log4j.properties

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Liu Yongjian  
View profile  
 More options Sep 23 2010, 3:02 pm
From: Liu Yongjian <ggd...@gmail.com>
Date: Fri, 24 Sep 2010 03:02:17 +0800
Local: Thurs, Sep 23 2010 3:02 pm
Subject: Re: [curn-users] Can not use Log4j on Windows

It's working , Thanks Brian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Liu Yongjian  
View profile  
 More options Sep 23 2010, 3:06 pm
From: Liu Yongjian <ggd...@gmail.com>
Date: Fri, 24 Sep 2010 03:06:32 +0800
Local: Thurs, Sep 23 2010 3:06 pm
Subject: Re: [curn-users] Can not use Log4j on Windows

Now I found another problems on Ubuntu:

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Clapper  
View profile  
 More options Sep 23 2010, 3:08 pm
From: Brian Clapper <b...@clapper.org>
Date: Thu, 23 Sep 2010 15:08:52 -0400
Local: Thurs, Sep 23 2010 3:08 pm
Subject: Re: [curn-users] Can not use Log4j on Windows
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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Clapper  
View profile  
 More options Sep 23 2010, 3:11 pm
From: Brian Clapper <b...@clapper.org>
Date: Thu, 23 Sep 2010 15:11:02 -0400
Local: Thurs, Sep 23 2010 3:11 pm
Subject: Re: [curn-users] Can not use Log4j on Windows
On 09/23/2010 03:06 PM, Liu Yongjian wrote:

> Now I found another problems on Ubuntu:

> 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?

http://www.clapper.org/software/java/curn/download/3.2.7/users-guide/...

--
-Brian

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Liu Yongjian  
View profile  
 More options Sep 23 2010, 3:11 pm
From: Liu Yongjian <ggd...@gmail.com>
Date: Fri, 24 Sep 2010 03:11:30 +0800
Local: Thurs, Sep 23 2010 3:11 pm
Subject: Re: [curn-users] Can not use Log4j on Windows

.....
What is the matter ?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Liu Yongjian  
View profile  
 More options Sep 23 2010, 3:14 pm
From: Liu Yongjian <ggd...@gmail.com>
Date: Fri, 24 Sep 2010 03:14:56 +0800
Local: Thurs, Sep 23 2010 3:14 pm
Subject: Re: [curn-users] Can not use Log4j on Windows

OMG, I forgot adding the log4j dependency again. Dam !!

Thanks again, Brian.

It's working properly now .


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Clapper  
View profile  
 More options Sep 23 2010, 3:15 pm
From: Brian Clapper <b...@clapper.org>
Date: Thu, 23 Sep 2010 15:15:45 -0400
Local: Thurs, Sep 23 2010 3:15 pm
Subject: Re: [curn-users] Can not use Log4j on Windows
On 09/23/2010 03:14 PM, Liu Yongjian wrote:

> OMG, I forgot adding the log4j dependency again. Dam !!

> Thanks again, Brian.

> It's working properly now .

Excellent.
--
-Brian

Brian Clapper, http://www.clapper.org/bmc/
A child's education should begin at least 100 years before he is born.
        -- Oliver Wendell Holmes


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »