You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Omar Chiyean <om...@gmail.com> on 2009/11/02 07:20:41 UTC

Logging trouble...

Hi there...
A weeks ago, I make some questions, and  changed to pdfbox 0.8.0 (thanks
Andreas
for your valious help). I use it to extract text, but this version throws a
lot of info logging
messages that i don't want to get, because it'll be a part of my
application..

I have tried to change loggin.properties, or work with the logger class,
with no
luck. Messages keep appearing.

I found the line in the code that makes this annoying messages (for me).
Is in the org.apache.pdfbox.util.PDFStreamEngine class.

I comment this line but i can't build again nor compile this class again
to replace it in my class distribution...

Can some one help, to get rid of this or to build the package??

Thanks in advance

Re: Logging trouble...

Posted by Andreas Lehmkühler <an...@lehmi.de>.
Hi,

Omar Chiyean wrote:
> Hi Andreas...
> 
> I made a new dist with the code above and It worked as you wrote
> using -Djava.util.logging.config.file=logging.properties
> Maybe compiler was caching object code...
> Why happens this kind of stuff??
You are using a computer and from time to time they do not behave 
logically ;-))

> By the way the two alternatives work fine, but I will stay with the one
> I built with the log.info line commented...
> 
> Thanks for your time...
> 2009/11/3 Omar Chiyean <om...@gmail.com>
> ....

BR
Andreas Lehmkühler

Re: Logging trouble...

Posted by Omar Chiyean <om...@gmail.com>.
Hi Andreas...

I made a new dist with the code above and It worked as you wrote
using -Djava.util.logging.config.file=logging.properties
Maybe compiler was caching object code...
Why happens this kind of stuff??

By the way the two alternatives work fine, but I will stay with the one
I built with the log.info line commented...

Thanks for your time...
2009/11/3 Omar Chiyean <om...@gmail.com>

> Sure...
> Here I'm posting my code...
>
> import java.io.*;
> import java.lang.*;
> import java.util.Vector;
> import org.apache.pdfbox.pdmodel.*;
> import org.apache.pdfbox.util.*;
> public class myPDFStripper{
>
>  public static void main(String[] args) throws IOException{
>   PDDocument doc = null;
>   try {
>             doc = PDDocument.load("some.pdf");
>             PDFTextStripper stripper = new PDFTextStripper("UTF-8");
>             String text = stripper.getText(doc);
>   } finally {
>             if (doc != null) {
>                 doc.close();
>             }
>         }
>  }
> }
>
>
>
> 2009/11/3 Andreas Lehmkühler <an...@lehmi.de>
>
> Hi,
>>
>>
>> Omar Chiyean wrote:
>>
>>> Hi Andreas..
>>> Thanks for your help...
>>>
>>> But what you wrote about running JVM with [1]
>>> was not lucky..
>>> I use  .level=FINEST and .level=ERROR
>>> with no luck...
>>> Messages keep appearing...
>>>
>> Hmm, there has to be still something wrong with your configuration. It
>> works fine for me. BTW,  ERROR isn't a valid logging level, use SEVERE
>> instead. Sorry, for that.
>>
>> How do you start the text extraction? Can you give us some details?
>>
>> BR
>> Andreas Lehmkühler
>>
>
>

Re: Logging trouble...

Posted by Omar Chiyean <om...@gmail.com>.
Sure...
Here I'm posting my code...

import java.io.*;
import java.lang.*;
import java.util.Vector;
import org.apache.pdfbox.pdmodel.*;
import org.apache.pdfbox.util.*;
public class myPDFStripper{

 public static void main(String[] args) throws IOException{
  PDDocument doc = null;
  try {
            doc = PDDocument.load("some.pdf");
            PDFTextStripper stripper = new PDFTextStripper("UTF-8");
            String text = stripper.getText(doc);
  } finally {
            if (doc != null) {
                doc.close();
            }
        }
 }
}



2009/11/3 Andreas Lehmkühler <an...@lehmi.de>

> Hi,
>
>
> Omar Chiyean wrote:
>
>> Hi Andreas..
>> Thanks for your help...
>>
>> But what you wrote about running JVM with [1]
>> was not lucky..
>> I use  .level=FINEST and .level=ERROR
>> with no luck...
>> Messages keep appearing...
>>
> Hmm, there has to be still something wrong with your configuration. It
> works fine for me. BTW,  ERROR isn't a valid logging level, use SEVERE
> instead. Sorry, for that.
>
> How do you start the text extraction? Can you give us some details?
>
> BR
> Andreas Lehmkühler
>

Re: Logging trouble...

Posted by Andreas Lehmkühler <an...@lehmi.de>.
Hi,

Omar Chiyean wrote:
> Hi Andreas..
> Thanks for your help...
> 
> But what you wrote about running JVM with [1]
> was not lucky..
> I use  .level=FINEST and .level=ERROR
> with no luck...
> Messages keep appearing...
Hmm, there has to be still something wrong with your configuration. It 
works fine for me. BTW,  ERROR isn't a valid logging level, use SEVERE 
instead. Sorry, for that.

How do you start the text extraction? Can you give us some details?

BR
Andreas Lehmkühler

Re: Logging trouble...

Posted by Omar Chiyean <om...@gmail.com>.
Hi Andreas..
Thanks for your help...

But what you wrote about running JVM with [1]
was not lucky..
I use  .level=FINEST and .level=ERROR
with no luck...
Messages keep appearing...

As i wrote I found the line in the code that was producing
this info to console, I comment it and build source with
ant as you wrote..

And now it works... It doesn't appear the info loggin to
console...

2009/11/2 Andreas Lehmkühler <an...@lehmi.de>

> Hi,
>
>
>
> Omar Chiyean wrote:
>
>> Hi there...
>> A weeks ago, I make some questions, and  changed to pdfbox 0.8.0 (thanks
>> Andreas
>> for your valious help). I use it to extract text, but this version throws
>> a
>> lot of info logging
>> messages that i don't want to get, because it'll be a part of my
>> application..
>>
>> I have tried to change loggin.properties, or work with the logger class,
>> with no
>> luck. Messages keep appearing.
>>
> Do you start ExtractText with [1] as JVM parameter?
> Is the properties file on your path?
> Do you adjust the ".level" value in logging-properties, e.g. like that
>
> .level=ERROR
>
> [1] -Djava.util.logging.config.file=logging.properties
>
>
> I found the line in the code that makes this annoying messages (for me).
>> Is in the org.apache.pdfbox.util.PDFStreamEngine class.
>>
>> I comment this line but i can't build again nor compile this class again
>> to replace it in my class distribution...
>>
>> Can some one help, to get rid of this or to build the package??
>>
> That should be easy by using ant. Just make your changes to the source an
> run "ant compile" or just "ant" in the pdfbox main folder. Of course you
> have to add the modifed classes to your path/jar.
>
>
> BR
> Andreas Lehmkühler
>

Re: Logging trouble...

Posted by Andreas Lehmkühler <an...@lehmi.de>.
Hi,


Omar Chiyean wrote:
> Hi there...
> A weeks ago, I make some questions, and  changed to pdfbox 0.8.0 (thanks
> Andreas
> for your valious help). I use it to extract text, but this version throws a
> lot of info logging
> messages that i don't want to get, because it'll be a part of my
> application..
> 
> I have tried to change loggin.properties, or work with the logger class,
> with no
> luck. Messages keep appearing.
Do you start ExtractText with [1] as JVM parameter?
Is the properties file on your path?
Do you adjust the ".level" value in logging-properties, e.g. like that

.level=ERROR

[1] -Djava.util.logging.config.file=logging.properties

> I found the line in the code that makes this annoying messages (for me).
> Is in the org.apache.pdfbox.util.PDFStreamEngine class.
> 
> I comment this line but i can't build again nor compile this class again
> to replace it in my class distribution...
> 
> Can some one help, to get rid of this or to build the package??
That should be easy by using ant. Just make your changes to the source 
an run "ant compile" or just "ant" in the pdfbox main folder. Of course 
you have to add the modifed classes to your path/jar.


BR
Andreas Lehmkühler