You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Sean Bridges (JIRA)" <ji...@apache.org> on 2009/05/13 22:20:45 UTC

[jira] Created: (PDFBOX-472) use commons logging

use commons logging
-------------------

                 Key: PDFBOX-472
                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
             Project: PDFBox
          Issue Type: Improvement
    Affects Versions: 0.8.0-incubator
            Reporter: Sean Bridges
             Fix For: 0.8.0-incubator


LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.

It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-472) use commons logging

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738517#action_12738517 ] 

Jukka Zitting commented on PDFBOX-472:
--------------------------------------

> How do we resolve this and move forward? 

Sean submitted a patch for this, so lets go with that unless someone wants to submit an alternative patch or has a good argument for why the status quo is better.

> use commons logging
> -------------------
>
>                 Key: PDFBOX-472
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>         Attachments: logpatch
>
>
> LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.
> It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-472) use commons logging

Posted by "Sean Bridges (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Bridges updated PDFBOX-472:
--------------------------------

    Attachment: logpatch

this patch switches to Apache Commons Logging, allowing users to configure their logging as they see fit



> use commons logging
> -------------------
>
>                 Key: PDFBOX-472
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>         Attachments: logpatch
>
>
> LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.
> It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PDFBOX-472) use commons logging

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-472.
---------------------------------------

    Resolution: Fixed

I've added Seans patch with version 811063. I've to make some slight changes concerning checkstyle compliance.

Thanks to Sean for his contribution.

> use commons logging
> -------------------
>
>                 Key: PDFBOX-472
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>         Attachments: logpatch
>
>
> LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.
> It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-472) use commons logging

Posted by "Hannes Erven (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744407#action_12744407 ] 

Hannes Erven commented on PDFBOX-472:
-------------------------------------

Is there any progress on this issue? Is help needed?


I've run into the same problem (Eclipse RCP app with read-only install area) and temporarily "fixed" this by changing the log file path to File.createTempFile() if the "PDFBox.log" is not writeable by the user. My modification is (LoggingObject.java line 34):


File logFile = new File("PDFBox.log");
if (! (
		(logFile.exists() || logFile.createNewFile())
		&&
		logFile.canWrite()
	  )
){
	logFile = File.createTempFile("PDFBox", ".log");
}
FileHandler fh = new FileHandler(logFile.getCanonicalPath(), true);

> use commons logging
> -------------------
>
>                 Key: PDFBOX-472
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>         Attachments: logpatch
>
>
> LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.
> It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-472) use commons logging

Posted by "Jeremias Maerki (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709566#action_12709566 ] 

Jeremias Maerki commented on PDFBOX-472:
----------------------------------------

Well, it's relatively easy to re-route JDK logging to any other logging framework. But I guess abstractions such as JCL or SLF4J make that a bit easier. At any rate, logging to a file by default is probably not the best idea as Sean hints at. For a command-line application, not a problem, but when PDFBox is used embedded it's better to leave logging configuration to the user of the library. In Apache FOP we're using JCL and are mostly happy with the choice. The only problem (solved in the meantime) was to isolate event message per document being processed in a multi-threaded environment. Similar problem in PDFBox maybe (depending on the requirements). See http://xmlgraphics.apache.org/fop/trunk/events.html for what I came up with.

Additional opinions?

> use commons logging
> -------------------
>
>                 Key: PDFBOX-472
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>         Attachments: logpatch
>
>
> LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.
> It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-472) use commons logging

Posted by "Daniel Wilson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738370#action_12738370 ] 

Daniel Wilson commented on PDFBOX-472:
--------------------------------------

I think everyone agrees that the logging should be changed.

If I'm reading this right, 3 experience Java developers, 2 of them on the PDFBox team, prefer 3 different ways of changing.

How do we resolve this and move forward?

For my needs, the current process is OK, though the performance hit on the logger().fine line displeases me.  But for others, what I put in is not OK.

Thanks!

> use commons logging
> -------------------
>
>                 Key: PDFBOX-472
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>         Attachments: logpatch
>
>
> LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.
> It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-472) use commons logging

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709772#action_12709772 ] 

Jukka Zitting commented on PDFBOX-472:
--------------------------------------

I personally prefer SLF4J, but JCL or JUL is also fine.

The marker mechanism in SLF4J (and the backends that support it) provide reasonably simple a way to associate log messages with the documents being processed.

> use commons logging
> -------------------
>
>                 Key: PDFBOX-472
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>         Attachments: logpatch
>
>
> LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.
> It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-472) use commons logging

Posted by "Daniel Wilson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709552#action_12709552 ] 

Daniel Wilson commented on PDFBOX-472:
--------------------------------------

Thanks for the patch, Sean.

Developers, do you see this as the best way to go?  If so, I'll be glad to apply the patch.

> use commons logging
> -------------------
>
>                 Key: PDFBOX-472
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>         Attachments: logpatch
>
>
> LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.
> It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-472) use commons logging

Posted by "Sean Bridges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12715740#action_12715740 ] 

Sean Bridges commented on PDFBOX-472:
-------------------------------------

As a further incentive to apply the patch above, while extracting text ~15% of the time is spent executing the line,

logger().fine("token: " + next.toString());

in PDFStreamEngine.processSubstream(...)

The patch submited does a isDebugEnabled test which avoids the toString() calls.


For a client, a library that Uses commons logging or slf4j is much easier to integrate than one that uses java util logging.

> use commons logging
> -------------------
>
>                 Key: PDFBOX-472
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-472
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>         Attachments: logpatch
>
>
> LoggingObject logs all pdfbox output to a file PDFBox.log using java.util.logging.  The app may not have permission to create this file, the user probably won't be looking at it for errors, and for long running server tasks, this file may grow very large.
> It would be much nicer to simply use apache commons logging (or even SLF4J) and allow the application to setup logging as they see fit.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.