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?
LVL 2
javiertbAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

girionisCommented:
 How do you read the output? Maybe you can use Log4j http://jakarta.apache.org/log4j/docs/
0
jimmackCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
javiertbAuthor Commented:
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
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

girionisCommented:
 Do you have access to the source code? You can always alter it in order to customize it.
0
javiertbAuthor Commented:
No, I don't have access.
0
girionisCommented:
 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
javiertbAuthor Commented:
Yes, I looked at the link but got no results with it.
0
girionisCommented:
 You can alter the output to go into a file instead of the console. What exactly didn't work?
0
javiertbAuthor Commented:
Worked when executed locally but got an error when executing in the web server.
0
girionisCommented:
 What kind of error?
0
javiertbAuthor Commented:
Unhandled System exception !
0
girionisCommented:
 Any more details? DId it say where it occured?
0
javiertbAuthor Commented:
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
jimmackCommented:
Have a look in the server log files.  Hopefully, there will be more details in there.
0
Mick BarryJava DeveloperCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.