Skip to main content
Version: v0.64.0

Deployment logs

This page describes how to use the H2O MLOps Python client to retrieve and view deployment logs.

Retrieve log collection for a given deployment

The following is an example of how you can retrieve the logs of a deployment. This example assumes that a deployment with ID deployment_id has already been deployed.

logs = client.deployer.log.list_log_entries({'parent': deployment_id})

List the name of each log entry

Each log entry has a name and text_payload field. The following is an example of how you can list the names of each log entry in the collection.

[l.name for l in logs.log_entries]

Sample return:

['primary.1c85d1f7-dd67-45b1-8d43-f8646a6a00e3.artifact-fetcher',
'primary.1c85d1f7-dd67-45b1-8d43-f8646a6a00e3.artifact-processor',
'primary.1c85d1f7-dd67-45b1-8d43-f8646a6a00e3.events',
'primary.1c85d1f7-dd67-45b1-8d43-f8646a6a00e3.monitor-proxy',
'primary.1c85d1f7-dd67-45b1-8d43-f8646a6a00e3.runtime']

Print the content of a log entry

The following is an example of how you can print the text content of a log entry. In this example, the content of the fifth log entry from the preceding example is printed.

print(logs.log_entries[4].text_payload)

Sample return:

Picked up _JAVA_OPTIONS: -Dmojo.path=/data/model

. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.6.8)

2023-02-16 19:13:34.387 INFO 1 --- [ main] a.h.m.d.local.rest.ScorerApplication : Starting ScorerApplication using Java 17.0.5 on pr-d44760ec-8164-47c4-bc45-5b695380c229-766878f87f-thnh2 with PID 1 (/app/classes started by ? in /)
2023-02-16 19:13:34.391 INFO 1 --- [ main] a.h.m.d.local.rest.ScorerApplication : No active profile set, falling back to 1 default profile: "default"
2023-02-16 19:13:36.230 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2023-02-16 19:13:36.243 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-02-16 19:13:36.243 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.63]
2023-02-16 19:13:36.369 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-02-16 19:13:36.369 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1913 ms
2023-02-16 19:13:36.450 INFO 1 --- [ main] a.h.m.d.common.transform.MojoScorer : Loading Mojo pipeline from path /data/model
2023-02-16 19:13:36.455 INFO 1 --- [ main] a.h.m.r.a.backend.ZipFileReaderBackend : Opening mojo file: /data/model
2023-02-16 19:13:36.611 INFO 1 --- [ main] a.h.m.d.common.transform.MojoScorer : Mojo pipeline successfully loaded (-7698193545625922052).
2023-02-16 19:13:37.447 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2023-02-16 19:13:37.540 INFO 1 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-02-16 19:13:37.540 INFO 1 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2023-02-16 19:13:37.542 INFO 1 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
2023-02-16 19:13:37.931 INFO 1 --- [ main] a.h.m.d.local.rest.ScorerApplication : Started ScorerApplication in 4.147 seconds (JVM running for 4.892)

Feedback