Solved

XML --> PDF with RenderX XEP  logging to file

Posted on 2003-10-22
16
324 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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 …

785 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