Solved

XML --> PDF with RenderX XEP  logging to file

Posted on 2003-10-22
16
321 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Python Assistance 7 73
printing a file in reverse order is easy in recursion rather than in iteration 3 51
what is a "java.lang.System Property"   ? 20 57
eclipse argument 14 53
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…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

920 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

15 Experts available now in Live!

Get 1:1 Help Now