Solved

XML --> PDF with RenderX XEP  logging to file

Posted on 2003-10-22
16
320 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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 “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now