Work with logs in the Logs Explorer

The Logs Explorer is a tool in the Google Google Cloud console that you can use to retrieve, view, and analyze stored log entries. Use the Logs Explorer to inspect Fleet Engine logs and write queries against those logs.

To access the Logs Explorer from the Google Cloud console:

  1. Open the Google Cloud console.
  2. In the Search box at the top, enter Logs Explorer.
  3. Select Logs Explorer to open it.

For an overview on how to use the Logs Explorer, see View logs by using the Logs Explorer.

Example queries for Log Explorer

The following example queries show how you can search for different log entries in the Logs Explorer. For more information on how to build queries see Logging query language.

View all Fleet Engine logs

    type.googleapis.com/maps.fleetengine

View all RPCs to Fleet Engine that returned an error

    resource.type:"fleetengine.googleapis.com"
    severity=ERROR
    Show logs of RPCs made to the UpdateVehicle method.
    logName="projects/project-id/logs/fleetengine.googleapis.com%2Fupdate_vehicle"

Show logs for a specific vehicle ID

    resource.type="fleetengine.googleapis.com/Fleet"
    labels.vehicle_id="vehicle_id"

Show logs for a specific trip ID

  • To make sure your query captures all logs, use the =~ operator.
  • This filter matches any log that includes the value in the label, rather than performing a strict equality check.
    resource.type="fleetengine.googleapis.com/Fleet"
    labels.trip_id=~"trip_id"

Show logs for a vehicle over a specific time period

    resource.type="fleetengine.googleapis.com/Fleet"
    labels.vehicle_id="vehicle_id"
    timestamp>="2020-09-24T20:00:00.000Z"
    timestamp<"2020-09-24T21:00:00.000Z"

What's next

Explore the contents of your logs and understand log structure.