Link to home
Start Free TrialLog in
Avatar of javiertb
javiertb

asked on

XML --> PDF with RenderX XEP logging to file

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?
Avatar of girionis
girionis
Flag of Greece image

 How do you read the output? Maybe you can use Log4j http://jakarta.apache.org/log4j/docs/
ASKER CERTIFIED SOLUTION
Avatar of jimmack
jimmack

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of javiertb
javiertb

ASKER

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);
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No, I don't have access.
 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
Yes, I looked at the link but got no results with it.
 You can alter the output to go into a file instead of the console. What exactly didn't work?
Worked when executed locally but got an error when executing in the web server.
 What kind of error?
Unhandled System exception !
 Any more details? DId it say where it occured?
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.
Have a look in the server log files.  Hopefully, there will be more details in there.
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