Skip to main content
Solved

Attaching log file in pythonemailer


Forum|alt.badge.img
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!

 

 

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())
View original
Did this help you find an answer to your question?
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.

2 replies

Forum|alt.badge.img
  • Best Answer
  • November 9, 2015
Hi!

 

 

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())

Forum|alt.badge.img
  • Author
  • November 9, 2015
larry wrote:
Hi!

 

 

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())

Thank you, this really helps out.  


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings