You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Ji...@orcz.cz on 2002/11/20 11:09:25 UTC

Cannot log the same as fop.bat with -d option

What I must do, to make logger log everything, as FOP.BAT (with -d option)
does  ?

In servlet I log FOP (0.20.4) actions into file:

FileOutputStream log_fos = new FileOutputStream(log_file);
PrintStream log_ps = new PrintStream(log_fos);
if (log == null) {
        Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
          PatternFormatter formatter = new PatternFormatter(
                "[%{priority}]: %{message}\n%{throwable}" );
              LogTarget target = null;
              target = new StreamTarget(log_ps, formatter);
              hierarchy.setDefaultLogTarget(target);
              log = hierarchy.getLoggerFor("fop");
              log.setPriority(Priority.DEBUG);
              //log.setPriority(Priority.INFO);
 }
...
Driver driver = new Driver();
driver.setLogger(new org.apache.avalon.framework.logger.LogKitLogger(log));
....
Options options = new Options(new File(fop_conf_dir +  "userconfig.xml"));
...
driver.run();
log_fos.close();

Changing parameter in method log.setPriority doesn't help .

The FOP.BAT logs much more :

[DEBUG] Input mode:
[DEBUG] FO
[DEBUG] fo input file: d:\test.fo
[DEBUG] Output mode:
[DEBUG] pdf
[DEBUG] output file: d:\output.pdf
[DEBUG] OPTIONS
[DEBUG] user configuration file: C:
\javaProject\Klient\public_html\dt\fop\userconfig.xml
[DEBUG] debug mode on
[DEBUG] dump configuration
[DEBUG] quiet mode on
[DEBUG] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[DEBUG] reading user configuration file
[DEBUG] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[DEBUG] base directory: file:/d:/
[INFO] FOP 0.20.4
[DEBUG] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] building formatting object tree
etc ...

P.S.: I have some problem with upgrading from FOP version 0.20.3 to 0.20.4.
I wrote about it in thread " Strange error when upgrading from 0.20.3 to
0.20.4".
All that is logged in my log file is :

[INFO]: building formatting object tree
[INFO]: [1]
...then error occurs

but at the same time this goes to the standard output (in JDeveloper):

[WARNING] Screen logger not set.
[ERROR] Failed to read font metrics file
/C:/JavaProject/Klient/classes/jORManClient/Reports/Metrics/arial.xml :
Invalid InputSource.

That error is also strange, the same link (from userconfig.xml) to the same
metrics file, worked in 0.20.3 :

<font metrics-file
="/C:/JavaProject/Klient/classes/jORManClient/Reports/Metrics/arial.xml"
kerning="yes" embed-file
="/C:/JavaProject/Klient/classes/jORManClient/Reports/Metrics/arial.ttf">
  <font-triplet name="Arial" style="normal" weight="normal"/>
</font>





Re: Space checking

Posted by Oleg Tkachenko <ol...@multiconn.com>.
lepekhine wrote:

> I use fop 0.20.4 and docbook-xsl-1.55.0
> After processing the next code lines
> <figure>
>     <title>Figure Title</title>
>     <mediaobject><imageobject>
>     <imagedata fileref="figure.gif" align="center"/>
>     </imageobject></mediaobject>
> </figure>
> sometimes "Figure Title" turns to be just befor page break
> and the image is rendered at the beginning of the next page.
> I don't know is it fop's or docbook's feature, but do anybody know
> how to check available space before printing?
That's default xsl-fo behaviour. It's completely stylesheet author 
responsibility to set constraints like keep-together one. Dunno if docbook xsl 
set keep-* property on generated formatting objects. You'd better ask at 
docbook-apps list.

-- 
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


Space checking

Posted by lepekhine <le...@fors.spb.ru>.
I use fop 0.20.4 and docbook-xsl-1.55.0
After processing the next code lines
<figure>
    <title>Figure Title</title>
    <mediaobject><imageobject>
    <imagedata fileref="figure.gif" align="center"/>
    </imageobject></mediaobject>
</figure>
sometimes "Figure Title" turns to be just befor page break
and the image is rendered at the beginning of the next page.
I don't know is it fop's or docbook's feature, but do anybody know
how to check available space before printing?
 Thank you in advance.
Alexander

Re: Cannot log the same as fop.bat with -d option

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Jiri_Nejedly@orcz.cz wrote:

> What I must do, to make logger log everything, as FOP.BAT (with -d option)
> does  ?

Take a look at FopServlet.java example:

import org.apache.avalon.framework.logger.ConsoleLogger;
import org.apache.avalon.framework.logger.Logger;
...
Logger log = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG);
MessageHandler.setScreenLogger(log);
...
driver.setLogger(log);

-- 
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel