Cette page n'est pas encore disponible dans votre langue. Nous nous efforçons d'ajouter d'autres langues. Nous vous remercions de votre compréhension.

On this page
Help Center/ ModelArts/ Troubleshooting/ Inference Deployment/ AI Application Management/ Failed to Obtain Certain Logs on the ModelArts Log Query Page

Failed to Obtain Certain Logs on the ModelArts Log Query Page

Updated on 2024-06-11 GMT+08:00

Symptom

I used a base image to import AI applications through OBS and wrote some inference code for implementing the inference logic. After an error occurred, I attempted to use the fault logs to locate the fault. However, certain logs were not displayed on the log query page in ModelArts.

Possible Causes

To display the logs of an inference service, print the logs on the console through coding. Python logging used by inference base images allows the display of only warning logs. To display INFO logs, set the log level to INFO in the code.

Solution

In the PY file for the inference code, set the default level of logs output to the console to INFO. The example code is as follows:

import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback