.. _logs: 

Driverless AI Logs
==================

This section describes how to access Driverless AI logs and includes information on which logs to send in the event of a failure.

Accessing Driverless AI Logs
----------------------------

Driverless AI provides a number of logs that can be retrieved while visualizing datasets, while an experiment is running, and after an experiment is completed.

While Visualizing Datasets
~~~~~~~~~~~~~~~~~~~~~~~~~~

When running Autovisualization, you can access the Autoviz logs by clicking the **Display Logs** button on the Visualize Datasets page. 

.. figure:: images/display_logs_autovis.png
   :width: 406
   :height: 174
   :alt: Display Logs button 

.. figure:: images/autoviz_logging.png
   :alt: Autoviz logging

This page presents logs created while the dataset visualization was being performed. You can download the **vis-data-server.log** file by clicking the **Download Logs** button on this page. This file can be used to troubleshoot any issues encountered during dataset visualization.

While an Experiment is Running
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

While the experiment is running, you can access the logs by clicking on the **Log** button on the experiment screen. The **Log** button can be found in the CPU/Memory section.

.. figure:: images/experiment_running_log.png
   :width: 457
   :height: 132
   :alt: Log button

Clicking on the **Log** button will present the experiment logs in real time. You can download these logs by clicking on the **Download Logs** button in the upper right corner.

.. figure:: images/system_logging.png
   :alt: Log when experiment is running

Only the **h2oai_experiment.log** can be downloaded while the experiment is running (for example: **h2oai_experiment_tobosoru.log**).  It will have the same information as the logs being presented in real time on the screen.  

For troubleshooting purposes, it is best to view the complete **h2oai_experiment.log** (or **h2oai_experiment_anonymized.log**).  This will be available after the experiment finishes, as described in the next section.

After an Experiment has Finished
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the experiment has finished, you can download the logs by clicking on the **Download Logs** button at the center of the experiment screen.

.. figure:: images/download_logs.png
   :width: 332
   :height: 321
   :alt: Download Logs button

This will download a zip file which includes the following logs: 

- **h2oai_experiment.log**: This is the log corresponding to the experiment.
- **h2oai_experiment_anonymized.log**: This is the log corresponding to the experiment where all data in the log is anonymized.
- **h2oai_server.log**: Contains the logs for all experiments and all users.
- **h2oai_server_anonymized.log**: Contains the logs for all experiments and all users where all data in the log is anonymized.
- **h2o.log**: This is the log corresponding to H2O-3. (H2O-3 is used internally for parts of Driverless AI.)

For troubleshooting, it is best to view the **h2oai_experiment.log** or **h2oai_experiment_anonymized.log**.  

The following additional information about your particular experiment will also be included in the zip file:

- **tuning_leaderboard.txt**: The results of the parameter tuning stage. This contains the model parameters investigated and their performance.
- **gene_summary.txt**: A summary of the feature transformations available for each gene over the feature engineering iterations
- **features.txt**: The features used in the final Driverless AI model along with feature importance and feature description
- **details folder**: Contains standard streams for each of the subprocesses performed by Driverless A. This information is for debugging purposes.

During Model Interpretation
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Driverless AI allows you to view and download Python and/or Java logs while MLI is running. Note that these logs are not available for time-series experiments.

.. figure:: images/mli_logging.png
   :alt: MLI runtime logs

- The **Display MLI Python Logs** button allows you to view or download the Python log for the model interpretation. The downloaded file is named **h2oai_experiment_{mli_key}.log**.  
- The **Display MLI Java Logs** button allows you to view or download the Java log for the model interpretation. The downloaded file is named  **mli_experiment_{mli_key}.log**.

After Model Interpretation
~~~~~~~~~~~~~~~~~~~~~~~~~~

You can view an MLI log for completed model interpretations by selecting the **Download MLI Logs** link on the MLI page. 

.. figure:: images/download_mli_logs.png
   :width: 531
   :height: 335
   :alt: Download MLI Logs button

This will download a zip file which includes the following logs: 

- **h2oai_experiment_{mli_key}.log**: This is the log corresponding to the model interpretation.
- **h2oai_experiment_{mli_key}_anonymized.log**: This is the log corresponding to the model interpretation where all data in the log is anonymized.
- **mli_experiment_{mli_key}.log**: This is the Java log corresponding to the model interpretation.

This file can be used to view logging information for successful interpretations. If MLI fails, then those logs are in **./tmp/h2oai_experiment_{mli_key}.log**, **./tmp/h2oai_experiment_{mli_key}_anonymized.log**, and **./tmp/mli_experiment_{mli_key}.log**.

Sending Logs to H2O
-------------------

This section describes the logs to send in the event of failures when running Driverless AI.

Dataset Failures
~~~~~~~~~~~~~~~~

- **Adding Datasets**: If a dataset fails to import, a message on the screen should provide the reason for the failure. The logs to send are available in the Driverless AI **./tmp** folder.

- **Dataset Details**: If a failure occurs when attempting to view Dataset Details, the logs to send are available in the Driverless AI **./tmp** folder. 

- **Autovisualization**: If a failure occurs when attempting to Visualize Datasets, a message on the screen should provide a reason for the failure. The logs to send are available in the Driverless AI **./tmp** folder.

Experiments
~~~~~~~~~~~

- **While Running an Experiment**: As indicated previously, a **Log** button is available on the Experiment page. Clicking on the **Log** button will present the experiment logs in real time. You can download these logs by clicking on the **Download Logs** button in the upper right corner. You can also retrieve the **h2oai_experiment.log** for the corresponding experiment in the Driverless AI **./tmp** folder. 

MLI
~~~

- **During Model Interpretation**: If a failure occurs during model interpretation, then the logs to send are **./tmp/h2oai_experiment_{mli_key}.log** and **./tmp/h2oai_experiment_{mli_key}_anonymized.log**.
