Solved
Attaching log file in pythonemailer
I am using FME desktop and when the process completes I want to send out a email. I have that working but I also want to attach the log. I am not sure how to do that with the attachments parameters in the "PythonEmailer" Any help woudl be awesome.
Best answer by larry
Hi!
View original
If you look at the usage tab for that transformer, the file or files are a list of comma separated values.
Note that while your workspace is running, the log file is already open in writing mode thus sending it right away with this transformer may let the log file looks truncated because some information is not written to it yet.
If you want a way to have the log file name, a PythonCaller with this code before the PythonEmailer will extract it in the _logfile attribute:
import fmeobjects
def processFeature(feature):
feature.setAttribute("_logfile", fmeobjects.FMELogFile().getFileName())
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.