Page 1 of 1

DITA-OT logging

Posted: Fri Mar 13, 2015 7:12 pm
by sanGeoff
Is it possible to have oXygen also save the build log from a transform to the output folder?

Also, is there any information on what oXygen considers a warning, error, or failure?
Currently we have a custom tool that can filter log files by lines matching the following:

Code: Select all

if ((
txt.Contains("[java] error") ||
txt.Contains(": Error!") ||
txt.Contains("[error]") ||
txt.Contains(": error:") ||
txt.Contains(": warning!") ||
txt.Contains(": warning:") ||
txt.Contains("] error:") ||
txt.Contains("] warning:") ||
txt.Contains("[info]") ||
txt.Contains("[warn]") ||
txt.Contains("build failed") ||
txt.Contains("system cannot find the path specified") ||
txt.Contains("system cannot find the file specified") ||
txt.Contains("contains space in its file name")
) && !txt.Contains("[dotj037w]") )

Re: DITA-OT logging

Posted: Mon Mar 16, 2015 10:04 am
by Radu
Hi,

We do not yet have a specific setting for this but we will consider adding one in the future.

You can edit the transformation scenario and in the Advanced tab to set the "Additional arguments" parameter to something like:

-logfile ${cfd}/test.log

in order to instruct the ANT process to save all output to a file called test.log located in the same place as the DITA Map.
The problem with this approach is that once the ANT process starts writing the log to a file it will no longer output it to the standard console.

About this question:
Also, is there any information on what oXygen considers a warning, error, or failure?
We also have a similar tool which tries to detect from the console lines output by ANT possible errors and warnings based on certain patterns.
For example we check if a line starts with [DOT for DITA OT specific errors.
We also check for [fop] [ERROR] patterns which appear when Apache FOP is run to produce the PDF.
And also for Fatal Error! lines which are usually given when an XSLT stylesheet crashes for some reason.
Then we try to create a message from that line and possibly the URL of a resource which should be opened when the message is double clicked.

Regards,
Radu

Re: DITA-OT logging

Posted: Mon Mar 16, 2015 9:44 pm
by sanGeoff
Thanks for the info, Yeah that is what I figured when I could not find any options.

It did give me some ideas and I found some better options. It looks like ant has some pretty robust logging options. Just putting the following line in the DITA_OT build file creates a log file as well as output to oxygen:

Code: Select all

<record name="logfile.txt" action="start" append="false" />
Looks like there is also a set of -listener options. I can even set it up to email certain messages. Or implement my own java class logger that could parse and filter the log.

Re: DITA-OT logging

Posted: Tue Mar 17, 2015 9:39 am
by Radu
Hi,

Making changes in the build file is indeed another way to do this.
You can also have your custom build file:

http://www.oxygenxml.com/doc/ug-oxygen/ ... -file.html

to avoid making modifications to the build.xml which comes with the DITA OT distribution.

Regards,
Radu