Read Logs From Service

If you use the standard python logging package for logging in your services, you will be able to view these logs from outside the service.

The logs from the service can be streamed from the dashboard using the log link for the service.

The logs can also be read using the CLI, for instance:

>>> mvi logs my_service 

Options for Reading the Logs Using the CLI

There are a few options that can be passed to the logs command to make reading the logs a bit more pleasant.

  • n , --tail: Output specified number of lines at the end of logs. [default: 50]

  • f, --follow: If the logs should be followed [default: False]

  • d, --date: Show logs since given datetime.

Tip

mvi logs is compatible with grep so to filter on logs containing WARNING one can run the following:

>>> mvi logs my_service --follow | grep WARNING 

Or if using powershell on windows:

>>> mvi logs my_service --follow | findstr WARNING