Solved

XML --> PDF with RenderX XEP  logging to file

Posted on 2003-10-22
16
325 Views
Last Modified: 2012-08-14
Hi,

I need to have all the output logging to a file while converting an XML to  PDF with XEP. How can I do it?
0
Comment
Question by:javiertb
  • 6
  • 6
  • 2
  • +1
16 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 9597516
 How do you read the output? Maybe you can use Log4j http://jakarta.apache.org/log4j/docs/
0
 
LVL 15

Accepted Solution

by:
jimmack earned 250 total points
ID: 9597550
How are you running it?  If it's from the batch/shell script, you could do:

xep .... > log.txt

or

./xep.sh .... > log.txt

If you are using the API's within your own Java code, you could redirect the stdout

Try the following for a starter:

http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20184445.html?query=redirect+stdout&searchType=topic
0
 
LVL 2

Author Comment

by:javiertb
ID: 9597645
I'm trying to do it from code. When I execute the code to transform xml to pdf I see xep log messages in the std out (without having to define a logger). How can I do from code to extract these messages to a file.  This is how I do it with fop:

org.apache.log.Logger log = null;

 PatternFormatter formatter = new PatternFormatter("%{time} - [%{priority}]: %{message}\n%{throwable}" );
 LogTarget target = null;
 target = new StreamTarget(new FileOutputStream(new File("d:\\out.log")), formatter);
     
 Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
       
 hierarchy.setDefaultLogTarget(target);
       
 log = hierarchy.getLoggerFor("fop");
 log.setPriority(Priority.INFO);
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 35

Assisted Solution

by:girionis
girionis earned 250 total points
ID: 9597954
 Do you have access to the source code? You can always alter it in order to customize it.
0
 
LVL 2

Author Comment

by:javiertb
ID: 9598131
No, I don't have access.
0
 
LVL 35

Expert Comment

by:girionis
ID: 9598220
 Not sure how you could do it withoutaltering the source code. Have you looked at the link jimmack posted?

  Also look here for redirecting the standard/error output to a file: http://javaalmanac.com/egs/java.lang/Redirect.html
0
 
LVL 2

Author Comment

by:javiertb
ID: 9598766
Yes, I looked at the link but got no results with it.
0
 
LVL 35

Expert Comment

by:girionis
ID: 9598842
 You can alter the output to go into a file instead of the console. What exactly didn't work?
0
 
LVL 2

Author Comment

by:javiertb
ID: 9598866
Worked when executed locally but got an error when executing in the web server.
0
 
LVL 35

Expert Comment

by:girionis
ID: 9601448
 What kind of error?
0
 
LVL 2

Author Comment

by:javiertb
ID: 9604735
Unhandled System exception !
0
 
LVL 35

Expert Comment

by:girionis
ID: 9604764
 Any more details? DId it say where it occured?
0
 
LVL 2

Author Comment

by:javiertb
ID: 9605452
No more details. This is the error from the web server. The details are concerning the coldfusion code from which the java code is called.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9605464
Have a look in the server log files.  Hopefully, there will be more details in there.
0
 
LVL 92

Expert Comment

by:objects
ID: 10181928
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between jimmack and girionis

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

objects
EE Cleanup Volunteer
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ejb stateless example 2 18
printf performancy 11 66
Java basic valueOf question 1 29
Java 8 to Java 6 8 20
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question