Title Extract Logs from Files
Generates a Mobile GDB with a record for each entry in a log file.
A series of views are created on top of the log table to look at log entries for particular operations.
This tool processes log files generated from either ArcGIS Server or ArcGIS Pro.
For ArcGIS Pro Diagnostic Log files, refer to this technical article.
License
Standard
ExtractFileLogs (diagnostic_files, folder)
Parameter | Explanation | Data Type |
---|---|---|
diagnostic_files |
Dialog Reference
The folder or files to extract. |
GPComposite |
folder |
Dialog Reference
The location to save the output. |
DEFolder |
ExtractFileLogs example 1 (Python window)
Extracts all the ArcGIS Server logs.
import arcpy
arcpy.udms.ExtractFileLogs("C:/Arcgis/ArcgisServer/logs", "D:/data/logs")
ExtractFileLogs example 2 (stand-alone script)
Extracts all the ArcGIS Pro diagnostic files.
import os
import arcpy
# By default, Pro logs to the user's documents folder.
folder = os.path.join(os.path.expanduser(r"~\Documents"), "ArcGIS", "Diagnostics")
result = arcpy.udms.ExtractFileLogs(
diagnostic_files=folder,
folder=folder,
)
logs = os.path.join(result[0], "logs")
count = arcpy.GetCount_management(logs)[0]
print(f"Extracted {int(count):,} log entries")