You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Tun Lin <ch...@singnet.com.sg> on 2003/11/27 10:01:19 UTC

Log4j configuration.

Hi,

I put my log4j.properties file in c:\\jarfiles and I did the following:

java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf

But I get the following:

log4j:WARN No appenders could be found for logger
(org.pdfbox.pdfparser.PDFParser).
log4j:WARN Please initialize the log4j system properly.

I read the manual at

http://jakarta.apache.org/log4j/docs/manual.html

It says the following needs to be done for Tomcat 4:

For example:
set CATALINA_OPTS=-Dlog4j.configuration=file:/c:/jarfiles/log4j.properties 
In the environment variables.
And I did just that.
Can I do the following?
 
java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
I can choose the ignore the error message but I would like to solve this problem
before moving on.
Anyone can help?



RE: Log4j configuration.

Posted by Tun Lin <ch...@singnet.com.sg>.
Hey Paul,

Really appreciate your help.

Here is the properties file I used:

log4j.rootCategory=stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %c - %m%n

Please advise. 

-----Original Message-----
From: Paul Smith [mailto:paul.smith@lawlex.com.au] 
Sent: Friday, November 28, 2003 9:44 AM
To: chentun@singnet.com.sg
Cc: log4j-user@jakarta.apache.org
Subject: RE: Log4j configuration.

On Fri, 2003-11-28 at 12:36, Tun Lin wrote:
> Hi Paul,
> 
> Thanks for your help and quick response but I still get the same error 
> message although there are some additional statements printed out 
> after running the following command as instructed by the last email.
> 

This is good, it helps to see that Log4j has found the file ok.

> Command typed:
> java -Dlog4j.configuration=file:///c:/jarfiles/log4j.properties
> -Dlog4j.debug=true org.pdfbox.searchengine.
> lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
> 
> Error message:
> log4j: Using URL [file:/c:/jarfiles/log4j.properties] for automatic 
> log4j config uration.
> log4j: Reading configuration from URL 
> file:/c:/jarfiles/log4j.properties
> log4j: Parsing for [root] with value=[stdout].
> log4j: Level token is [stdout].
> log4j: Category root set to DEBUG
> log4j: Finished configuring.
> log4j:WARN No appenders could be found for logger 
> (org.pdfbox.pdfparser.PDFParse r).
> log4j:WARN Please initialize the log4j system properly. 

Next, please paste the entire contents of the c:/jarfiles/log4j.properties file
into another email to the list.  It looks like that is the culprit.

cheers,

Paul Smith




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


RE: Log4j configuration.

Posted by Paul Smith <pa...@lawlex.com.au>.
On Fri, 2003-11-28 at 12:36, Tun Lin wrote:
> Hi Paul,
> 
> Thanks for your help and quick response but I still get the same error message
> although there are some additional statements printed out after running the
> following command as instructed by the last email.
> 

This is good, it helps to see that Log4j has found the file ok.

> Command typed:
> java -Dlog4j.configuration=file:///c:/jarfiles/log4j.properties
> -Dlog4j.debug=true org.pdfbox.searchengine.
> lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
> 
> Error message:
> log4j: Using URL [file:/c:/jarfiles/log4j.properties] for automatic log4j config
> uration.
> log4j: Reading configuration from URL file:/c:/jarfiles/log4j.properties
> log4j: Parsing for [root] with value=[stdout].
> log4j: Level token is [stdout].
> log4j: Category root set to DEBUG
> log4j: Finished configuring.
> log4j:WARN No appenders could be found for logger (org.pdfbox.pdfparser.PDFParse
> r).
> log4j:WARN Please initialize the log4j system properly. 

Next, please paste the entire contents of the
c:/jarfiles/log4j.properties file into another email to the list.  It
looks like that is the culprit.

cheers,

Paul Smith


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


RE: Log4j configuration.

Posted by Tun Lin <ch...@singnet.com.sg>.
Hi Paul,

Thanks for your help and quick response but I still get the same error message
although there are some additional statements printed out after running the
following command as instructed by the last email.

Command typed:
java -Dlog4j.configuration=file:///c:/jarfiles/log4j.properties
-Dlog4j.debug=true org.pdfbox.searchengine.
lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf

Error message:
log4j: Using URL [file:/c:/jarfiles/log4j.properties] for automatic log4j config
uration.
log4j: Reading configuration from URL file:/c:/jarfiles/log4j.properties
log4j: Parsing for [root] with value=[stdout].
log4j: Level token is [stdout].
log4j: Category root set to DEBUG
log4j: Finished configuring.
log4j:WARN No appenders could be found for logger (org.pdfbox.pdfparser.PDFParse
r).
log4j:WARN Please initialize the log4j system properly. 

-----Original Message-----
From: Paul Smith [mailto:paul.smith@lawlex.com.au] 
Sent: Friday, November 28, 2003 9:22 AM
To: chentun@singnet.com.sg
Cc: log4j-user@jakarta.apache.org
Subject: RE: Log4j configuration.

Please add another system property switch:  

-Dlog4j.debug=true 

e.g.

java -Dlog4j.configuration=file://c:/jarfiles/log4j.properties
org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf

and cut/paste what is displayed to standard out into an email to this list so
that we can see what is happening..

cheers,

Paul Smith

> You keep insisting on using non-url syntax for your setup even when 
> you reference the correct URL syntax.  Do this...
> 
> java -Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
> org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
> 
> Also, why are you saying...
> c:\\jarfiles\log4j.properties
> 
> You are escaping the first "\", but not the second one in the path.  
> Shouldn't it be?...
> c:\\jarfiles\\log4j.properties
> 
> Anyway, you have to use the URL syntax above for things to work.  BTW, 
> I've also seen the URL file syntax on Windows be...
> file:///c:/jarfiles/log4j.properties
> 
> Use whichever one works for you.
> 
> Jake
> 
> At 05:01 PM 11/27/2003 +0800, you wrote:
> >Hi,
> >
> >I put my log4j.properties file in c:\\jarfiles and I did the following:
> >
> >java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
> >org.pdfbox.searchengine.lucene.LucenePDFDocument 
> >C:\\pdf\h6603lab4.pdf
> >
> >But I get the following:
> >
> >log4j:WARN No appenders could be found for logger 
> >(org.pdfbox.pdfparser.PDFParser).
> >log4j:WARN Please initialize the log4j system properly.
> >
> >I read the manual at
> >
> >http://jakarta.apache.org/log4j/docs/manual.html
> >
> >It says the following needs to be done for Tomcat 4:
> >
> >For example:
> >set
> >CATALINA_OPTS=-Dlog4j.configuration=file:/c:/jarfiles/log4j.propertie
> >s
> >In the environment variables.
> >And I did just that.
> >Can I do the following?
> >
> >java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
> >org.pdfbox.searchengine.lucene.LucenePDFDocument 
> >C:\\pdf\h6603lab4.pdf I can choose the ignore the error message but I 
> >would like to solve this problem before moving on.
> >Anyone can help?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


RE: Log4j configuration.

Posted by Paul Smith <pa...@lawlex.com.au>.
Please add another system property switch:  

-Dlog4j.debug=true 

e.g.

java -Dlog4j.configuration=file://c:/jarfiles/log4j.properties
org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf

and cut/paste what is displayed to standard out into an email to this
list so that we can see what is happening..

cheers,

Paul Smith

> You keep insisting on using non-url syntax for your setup even when you
> reference the correct URL syntax.  Do this...
> 
> java -Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
> org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
> 
> Also, why are you saying...
> c:\\jarfiles\log4j.properties
> 
> You are escaping the first "\", but not the second one in the path.  Shouldn't
> it be?...
> c:\\jarfiles\\log4j.properties
> 
> Anyway, you have to use the URL syntax above for things to work.  BTW, I've also
> seen the URL file syntax on Windows be...
> file:///c:/jarfiles/log4j.properties
> 
> Use whichever one works for you.
> 
> Jake
> 
> At 05:01 PM 11/27/2003 +0800, you wrote:
> >Hi,
> >
> >I put my log4j.properties file in c:\\jarfiles and I did the following:
> >
> >java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
> >org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
> >
> >But I get the following:
> >
> >log4j:WARN No appenders could be found for logger 
> >(org.pdfbox.pdfparser.PDFParser).
> >log4j:WARN Please initialize the log4j system properly.
> >
> >I read the manual at
> >
> >http://jakarta.apache.org/log4j/docs/manual.html
> >
> >It says the following needs to be done for Tomcat 4:
> >
> >For example:
> >set 
> >CATALINA_OPTS=-Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
> >In the environment variables.
> >And I did just that.
> >Can I do the following?
> >
> >java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
> >org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf 
> >I can choose the ignore the error message but I would like to solve 
> >this problem before moving on.
> >Anyone can help?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Log4j configuration.

Posted by Kwok Peng Tuck <pe...@makmal.net>.
You can obtain copies of the binaries from the jakarta website.

Tun Lin wrote:

>Does anyone has the latest version of log4j?  
>
>-----Original Message-----
>From: Jacob Kjome [mailto:hoju@visi.com] 
>Sent: Friday, November 28, 2003 1:57 AM
>To: Log4J Users List
>Subject: Re: Log4j configuration.
>
>
>You keep insisting on using non-url syntax for your setup even when you
>reference the correct URL syntax.  Do this...
>
>java -Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
>org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
>
>Also, why are you saying...
>c:\\jarfiles\log4j.properties
>
>You are escaping the first "\", but not the second one in the path.  Shouldn't
>it be?...
>c:\\jarfiles\\log4j.properties
>
>Anyway, you have to use the URL syntax above for things to work.  BTW, I've also
>seen the URL file syntax on Windows be...
>file:///c:/jarfiles/log4j.properties
>
>Use whichever one works for you.
>
>Jake
>
>At 05:01 PM 11/27/2003 +0800, you wrote:
>  
>
>>Hi,
>>
>>I put my log4j.properties file in c:\\jarfiles and I did the following:
>>
>>java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
>>org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
>>
>>But I get the following:
>>
>>log4j:WARN No appenders could be found for logger 
>>(org.pdfbox.pdfparser.PDFParser).
>>log4j:WARN Please initialize the log4j system properly.
>>
>>I read the manual at
>>
>>http://jakarta.apache.org/log4j/docs/manual.html
>>
>>It says the following needs to be done for Tomcat 4:
>>
>>For example:
>>set 
>>CATALINA_OPTS=-Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
>>In the environment variables.
>>And I did just that.
>>Can I do the following?
>>
>>java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
>>org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf 
>>I can choose the ignore the error message but I would like to solve 
>>this problem before moving on.
>>Anyone can help?
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


RE: Log4j configuration.

Posted by Tun Lin <ch...@singnet.com.sg>.
Does anyone has the latest version of log4j?  

-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com] 
Sent: Friday, November 28, 2003 1:57 AM
To: Log4J Users List
Subject: Re: Log4j configuration.


You keep insisting on using non-url syntax for your setup even when you
reference the correct URL syntax.  Do this...

java -Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf

Also, why are you saying...
c:\\jarfiles\log4j.properties

You are escaping the first "\", but not the second one in the path.  Shouldn't
it be?...
c:\\jarfiles\\log4j.properties

Anyway, you have to use the URL syntax above for things to work.  BTW, I've also
seen the URL file syntax on Windows be...
file:///c:/jarfiles/log4j.properties

Use whichever one works for you.

Jake

At 05:01 PM 11/27/2003 +0800, you wrote:
>Hi,
>
>I put my log4j.properties file in c:\\jarfiles and I did the following:
>
>java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
>org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
>
>But I get the following:
>
>log4j:WARN No appenders could be found for logger 
>(org.pdfbox.pdfparser.PDFParser).
>log4j:WARN Please initialize the log4j system properly.
>
>I read the manual at
>
>http://jakarta.apache.org/log4j/docs/manual.html
>
>It says the following needs to be done for Tomcat 4:
>
>For example:
>set 
>CATALINA_OPTS=-Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
>In the environment variables.
>And I did just that.
>Can I do the following?
>
>java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
>org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf 
>I can choose the ignore the error message but I would like to solve 
>this problem before moving on.
>Anyone can help?


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


RE: Log4j configuration.

Posted by Tun Lin <ch...@singnet.com.sg>.
I still have the error message. Is it the jar version problem? 

-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com] 
Sent: Friday, November 28, 2003 1:57 AM
To: Log4J Users List
Subject: Re: Log4j configuration.


You keep insisting on using non-url syntax for your setup even when you
reference the correct URL syntax.  Do this...

java -Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf

Also, why are you saying...
c:\\jarfiles\log4j.properties

You are escaping the first "\", but not the second one in the path.  Shouldn't
it be?...
c:\\jarfiles\\log4j.properties

Anyway, you have to use the URL syntax above for things to work.  BTW, I've also
seen the URL file syntax on Windows be...
file:///c:/jarfiles/log4j.properties

Use whichever one works for you.

Jake

At 05:01 PM 11/27/2003 +0800, you wrote:
>Hi,
>
>I put my log4j.properties file in c:\\jarfiles and I did the following:
>
>java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
>org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
>
>But I get the following:
>
>log4j:WARN No appenders could be found for logger 
>(org.pdfbox.pdfparser.PDFParser).
>log4j:WARN Please initialize the log4j system properly.
>
>I read the manual at
>
>http://jakarta.apache.org/log4j/docs/manual.html
>
>It says the following needs to be done for Tomcat 4:
>
>For example:
>set 
>CATALINA_OPTS=-Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
>In the environment variables.
>And I did just that.
>Can I do the following?
>
>java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
>org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf 
>I can choose the ignore the error message but I would like to solve 
>this problem before moving on.
>Anyone can help?


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Log4j configuration.

Posted by Jacob Kjome <ho...@visi.com>.
You keep insisting on using non-url syntax for your setup even when you 
reference the correct URL syntax.  Do this...

java -Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf

Also, why are you saying...
c:\\jarfiles\log4j.properties

You are escaping the first "\", but not the second one in the 
path.  Shouldn't it be?...
c:\\jarfiles\\log4j.properties

Anyway, you have to use the URL syntax above for things to work.  BTW, I've 
also seen the URL file syntax on Windows be...
file:///c:/jarfiles/log4j.properties

Use whichever one works for you.

Jake

At 05:01 PM 11/27/2003 +0800, you wrote:
>Hi,
>
>I put my log4j.properties file in c:\\jarfiles and I did the following:
>
>java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
>org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
>
>But I get the following:
>
>log4j:WARN No appenders could be found for logger
>(org.pdfbox.pdfparser.PDFParser).
>log4j:WARN Please initialize the log4j system properly.
>
>I read the manual at
>
>http://jakarta.apache.org/log4j/docs/manual.html
>
>It says the following needs to be done for Tomcat 4:
>
>For example:
>set CATALINA_OPTS=-Dlog4j.configuration=file:/c:/jarfiles/log4j.properties
>In the environment variables.
>And I did just that.
>Can I do the following?
>
>java -Dlog4j.configuration=c:\\jarfiles\log4j.properties
>org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf
>I can choose the ignore the error message but I would like to solve this 
>problem
>before moving on.
>Anyone can help?


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org