DITA-OT logging

Post here questions and problems related to editing and publishing DITA content.
sanGeoff
Posts: 42
Joined: Mon Aug 18, 2014 11:50 pm

DITA-OT logging

Post 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]") )
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA-OT logging

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sanGeoff
Posts: 42
Joined: Mon Aug 18, 2014 11:50 pm

Re: DITA-OT logging

Post 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.
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA-OT logging

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply