I created an XPROC 3.0 pipeline that performs several tasks to reorganize files using element such as p:for-each, p:choose, file steps and validation steps. I would like to log the main events such as error, the files processed, etc.
The first solution I tried is :
- the creation of an empty log file
- each time I need to log an information, I use a <p:insert position="last-child">
- then I store the updated log file But I think this solution is not optimal because :
- the multiple accesses to the log file probably slow down the process
- sometimes, a fail occurs with an invalid log file, maybe because two steps access the log file at the same time.
Then I tried to concatenate the different messages at the different levels with
- <p:wrap-sequence/>
- <p:unwrap> to remove the unwanted wrapper
- <p:pack> (but this step can concatenate only two sources at a time)
But I find this second way not very elegant.
Can you advise me on the best practice to construct a log file ?
Thank you !