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](https://console.cloud.google.com).
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](https://cloud.google.com/logging/docs/view/logs-explorer-interface).

## 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](https://cloud.google.com/logging/docs/view/logging-query-language).

### View all Fleet Engine logs

```bash
    type.googleapis.com/maps.fleetengine
```

### View all RPCs to Fleet Engine that returned an error

```bash
    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

```bash
    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.

```bash
    resource.type="fleetengine.googleapis.com/Fleet"
    labels.trip_id=~"trip_id"
```

### Show logs for a vehicle over a specific time period

```bash
    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"
```

> [!NOTE]
> **Note:** Time values in this example are in Coordinated Universal Time (UTC) format. To specify a time zone, replace the letter Z at the end of the timestamp with +hh:mm or -hh:mm. For more information, see the [Cloud
> documentation](https://cloud.google.com/logging/docs/view/advanced-queries).

## What's next

Explore the contents of your logs and [understand log structure](https://developers.google.com/maps/documentation/mobility/operations/cloud-logging/log-structure.md.txt).