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?
I need to have all the output logging to a file while converting an XML to PDF with XEP. How can I do it?
How do you read the output? Maybe you can use Log4j http://jakarta.apache.org/log4j/docs/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.getDefaultHierar chy();
hierarchy.setDefaultLogTar get(target );
log = hierarchy.getLoggerFor("fo p");
log.setPriority(Priority.I NFO);
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.getDefaultHierar
hierarchy.setDefaultLogTar
log = hierarchy.getLoggerFor("fo
log.setPriority(Priority.I
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
Also look here for redirecting the standard/error output to a file: http://javaalmanac.com/egs/java.lang/Redirect.html
ASKER
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?
ASKER
Worked when executed locally but got an error when executing in the web server.
What kind of error?
ASKER
Unhandled System exception !
Any more details? DId it say where it occured?
ASKER
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
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