---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/logs](../index.md) / matchesPrefixFilters

# Function: matchesPrefixFilters()

> **matchesPrefixFilters**(`file`, `filters`): `boolean`

Defined in: [packages/b2c-tooling-sdk/src/operations/logs/list.ts:123](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/8fc17d8708d025c83fb0c44ca73198a200605153/packages/b2c-tooling-sdk/src/operations/logs/list.ts#L123)

Checks whether a top-level log file is selected by any of the given prefix filters.

A filter matches when the file's extracted category or its file name starts with
the filter (case-insensitive). Matching the file name lets a filter select a custom
logger whose name contains a dash, which the category alone cannot express.

## Parameters

### file

`Pick`\<[`LogFile`](../interfaces/LogFile.md), `"name"` \| `"prefix"`\>

Log file (its `name` and extracted `prefix`)

### filters

`string`[]

Prefix filters (without `/`)

## Returns

`boolean`

True when at least one filter matches

## Example

```ts
matchesPrefixFilters({name: 'custom-My-Api-blade1-20250125.log', prefix: 'custom-My'}, ['custom-My-Api']) // true
matchesPrefixFilters({name: 'customerror-blade1-20250125.log', prefix: 'customerror'}, ['custom-']) // false
```
