---
title: "Reference: Mastra.getLogger() | Core"
description: "Documentation for the `Mastra.getLogger()` method in Mastra, which retrieves the configured logger instance."
packages:
  - "@mastra/core"
---

# Mastra.getLogger()

The `.getLogger()` method is used to retrieve the logger instance that has been configured in the Mastra instance.

## Usage example

```typescript
mastra.getLogger();
```

## Parameters

This method does not accept any parameters.

## Returns

<PropertiesTable
  content={[
    {
      name: "logger",
      type: "TLogger",
      description:
        "The configured logger instance used for logging across all components (agents, workflows, etc.).",
    },
  ]}
/>

## Related

- [Logging overview](/docs/v1/observability/logging)
- [Logger reference](/reference/v1/logging/pino-logger)
