When you submit a MaxCompute job, you can generate a LogView URL to inspect its execution details and diagnose issues. This document explains how to generate a LogView URL using MaxCompute SDK for Java and how to retrieve one from the MaxCompute client.
For a full overview of LogView, see Use LogView to view job information.
Generate a LogView URL using the SDK
Use this method when building a programmatic integration — for example, to log the LogView URL alongside your job submission code.
MaxCompute SDK for Java provides the LogView interface. For the full API reference, see MaxCompute SDK for Java.
Instance i = odps.instances().get("<instance_id>");
String logviewUrl = odps.logview().generateLogView(i, <hours>);This snippet assumes you have already initialized an odps client object. For initialization steps, see MaxCompute SDK for Java.| Parameter | Description |
|---|---|
instance_id | The ID of the instance to inspect. |
hours | How long the generated URL remains valid, in hours. For example, 7*24 keeps the URL valid for 7 days. Set this to a duration long enough to cover your debugging window. |
Retrieve a LogView URL from the MaxCompute client
Use this method for interactive debugging from the command line. Run the following command in the MaxCompute client:
wait <instance_id>;The client returns the LogView URL for the specified instance.