You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bonekrusher <dj...@yahoo.com> on 2008/02/17 13:51:53 UTC

How to Log errors with Fop.bat 0.94

Hello,

I am running Fop 0.94 from a .net application. I pass all my arguments a
batch file to run Fop. If there are any errors they will display in the
command line dos window. I heard that FOP logs its errors some where. I
would like to pass those errors (if any) back to my .net application.

Is this possible?

Thanks

Bones

-- 
View this message in context: http://www.nabble.com/How-to-Log-errors-with-Fop.bat-0.94-tp15529153p15529153.html
Sent from the FOP - Dev mailing list archive at Nabble.com.


Re: How to Log errors with Fop.bat 0.94

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
We're getting off-topic for this mailing list (should be on fop-users
anyway), but here goes:

You need to use a different handler, the FileHandler (see example below).
You can configure the filename as you want. See
http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/FileHandler.html
for details.

More info:
http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html

The modification of fop.bat is probably ok. Good luck!

--------------------------------------------------------------
handlers=java.util.logging.FileHandler

# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers.  For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level= INFO

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

# default file output is in user's home directory.
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
com.xyz.foo.level = SEVERE
org.apache.fop.level = SEVERE
--------------------------------------------------------------

On 18.02.2008 14:10:37 bonekrusher wrote:
> 
> Thanks for the help.
> 
> Your second suggestion might be the better way for me. Following your Wiki,
> I have a newbie question.
> 
> I created a congif file :
> # Error log - FOP Config File
> # Set and change Default logging for FOP
> handlers= java.util.logging.ConsoleHandler
> 
> java.util.logging.ConsoleHandler.level = FINEST
> java.util.logging.ConsoleHandler.formatter =
> java.util.logging.SimpleFormatter
> 
> .level= INFO
> 
> # Well, the following line actually dances a little out of line :-(
> FOP.level = INFO
> 
> # This sets all FOP logging to INFO. Only rendering information is logged on
> the FINE level.
> org.apache.fop.level = INFO
> org.apache.fop.render.level = FINE
> # End of Custom
> 
> Then I added this line to my Fop.bat file:
> 
> set LOGCHOICE=-Djava.util.logging.config.file=C:/fop-0.94/lib/error.config
> 
> Is this correct and what is the name of the output file and where is it
> being output to?
> 
> -- 
> View this message in context: http://www.nabble.com/How-to-Log-errors-with-Fop.bat-0.94-tp15529153p15545080.html
> Sent from the FOP - Dev mailing list archive at Nabble.com.




Jeremias Maerki


Re: How to Log errors with Fop.bat 0.94

Posted by bonekrusher <dj...@yahoo.com>.
Thanks for the help.

Your second suggestion might be the better way for me. Following your Wiki,
I have a newbie question.

I created a congif file :
# Error log - FOP Config File
# Set and change Default logging for FOP
handlers= java.util.logging.ConsoleHandler

java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter

.level= INFO

# Well, the following line actually dances a little out of line :-(
FOP.level = INFO

# This sets all FOP logging to INFO. Only rendering information is logged on
the FINE level.
org.apache.fop.level = INFO
org.apache.fop.render.level = FINE
# End of Custom

Then I added this line to my Fop.bat file:

set LOGCHOICE=-Djava.util.logging.config.file=C:/fop-0.94/lib/error.config

Is this correct and what is the name of the output file and where is it
being output to?

-- 
View this message in context: http://www.nabble.com/How-to-Log-errors-with-Fop.bat-0.94-tp15529153p15545080.html
Sent from the FOP - Dev mailing list archive at Nabble.com.


Re: How to Log errors with Fop.bat 0.94

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I'm sure .NET lets you capture the output on stdout/stderr. Just search
the net for "capture stdout" together with the name of your preferred
programming language. I saw many examples.

An alternative is to write a config file for java.util.logging that
redirects log output to a file. You can then load the text file.
http://wiki.apache.org/xmlgraphics-fop/HowTo/SetupJDK14Logging

The most advanced/complicated alternative is probably to compile FOP for
.NET under IKVM and directly interface with FOP through .NET code. Not
an easy task, though.

On 17.02.2008 14:10:11 bonekrusher wrote:
> 
> Hello,
> 
> I am running Fop 0.94 from a .net application. I pass all my arguments a
> batch file to run Fop. If there are any errors they will display in the
> command line dos window. I heard that FOP logs its errors some where. I
> would like to pass those errors (if any) back to my .net application.
> 
> All my logs are being sent to the commons-logging-1.0.4.jar... How to access
> this?
> Is this possible?
> 
> Thanks
> 
> Bones
> 
> -- 
> View this message in context: http://www.nabble.com/How-to-Log-errors-with-Fop.bat-0.94-tp15529153p15529153.html
> Sent from the FOP - Dev mailing list archive at Nabble.com.




Jeremias Maerki