Solved

XML --> PDF with RenderX XEP  logging to file

Posted on 2003-10-22
16
327 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

688 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