I have built a package to load data from source system into HFM with the final step being emailing the error log to the system administrator; the package is working fine apart from this final step.
I have two options:
1. Email the log generated by the specified log path in the interface (this generates a log which logs the connection to HFM, number of records loaded/ rejected etc, not error details).
The issue I am facing with this option is that there is no choice to truncate the log file before each subsequent load. Therefore it logs the results of each load subsequently, and the error file keeps growing. Does anyone know how I can truncate this file?
2. Email the automatic log generated by ODI which has the random numbering on the end, e.g. HFMDataLoad97854353627349.log.
I want to add this file as an email attachment, however the unstable file name means it is not simple. Reading other threads I understand the process of using Copy File (with wildcard e. HFMDataLoad*) to write it to a file with a stable file name to then attach. The issue with this approach is that when there are multiple files within the location it e.g HFMDataLoad97854353627349.log, HFMDataLoad42654353627349.log, HFMDataLoad12354353627349.log within the directory there is no control which one it copies - it may therefore not copy the latest one.
For #1, you can delete/move the log file at the beginning of the package using odiFileDelete/OdiFileMove/OdiFileWait tools. This way the log file would be created newly every time giving your truncate behavior.