Question

FMEServer variable "job id group" available?


The LogFiles in FMEServer are put in separately folder, depending on the
number of digits, see https://docs.safe.com/fme/html/FME_Server_Documentation/Content/ReferenceManual/About_Log_Files.htm

“<LogDir>\engine\current|old\jobs\<number>\job_<value>.log

Where value
is the job ID and number is the job ID group,
which increments by thousand. Logs for job IDs from 0 - 999 are grouped into a
0 directory, Logs for job IDs from 1000 - 1999 are grouped into a 1000
directory, and so on.”

Is there an variable on FMEServer
for this  <number>? I need this in my Shutdown-Python-Skript
to get the logfiles independent from the number of digits.

Here my Shutdownscipt:

import shutil
import fme

datei = r"job_$(FME_JOB_ID).log"
number = r"1000"

src = r"C:/ProgramData/Safe Software/FMEServer///resources/logs/engine/current/jobs\\" + number +"\\" + datei
dest = r"$(OUT_COMBINATION)"

shutil.copy(src, dest)


 


2 replies

Userlevel 4

How about simply using the fme.logFileName variable in the fme module?

import fme
src = fme.logFileName

Documentation: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Configuration/FME_END_PYTHON.htm

Other than that you can use the REST API to retrieve the log file from FME Server.

Thank you for your help. fme.logFileName works perfect.

Reply