Hello
At ArcGIS Server 10.7 the "Request ID", aka requestId, was added to the service logs.
Is it possible to get the requestId in a SOE/SOI? I dont see any refererences to requestId in the SDK (Java) documentation.
The request properties contains ETag but this isnt the requestId.
Thanks
Bueller…?
Anyone…?
I have an answer for you!
import java.io.IOException;
import com.esri.arcgis.system.EnvironmentManager;
import com.esri.arcgis.system.IServerEnvironment;
import com.esri.arcgis.system.IServerEnvironmentProxy;
import com.esri.arcgis.system.UID;
class whatever
{
public static UUID getRequestID() throws AutomationException, IOException
{
EnvironmentManager envMgr = new EnvironmentManager();
try
{
UID envUID = new UID();
envUID.setValue("{32d4c328-e473-4615-922c-63c108f55e60}");
Object envObj = envMgr.getEnvironment(envUID);
IServerEnvironment env = new IServerEnvironmentProxy(envObj);
var reqIdStr = env.getProperties().getProperty("RequestID");
if (reqIdStr != null)
{
UUID reqId;
try
{
reqId = UUID.fromString(reqIdStr.toString());
return reqId;
}
catch(IllegalArgumentException e)
{
}
return UUID.randomUUID();
}
else
{
return UUID.randomUUID();
}
}
finally {
envMgr.release();
}
}
}
OMG @LorenCress thank you so much, I will test this out ASAP 😄