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

[@salesforce/b2c-tooling-sdk](../../modules.md) / [cli](../index.md) / LogRedactionHook

# Type Alias: LogRedactionHook

> **LogRedactionHook** = `Hook`\<`"b2c:log-redaction"`\>

Defined in: [packages/b2c-tooling-sdk/src/cli/hooks.ts:464](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/cli/hooks.ts#L464)

Hook type for `b2c:log-redaction`.

Implement this hook to remove more from log output than the built-in
redaction does, for example secrets at any depth or tokens inside messages.
Called during command initialization, before other plugin hooks run, so
their log entries are redacted too.

## Plugin Registration

```json
{
  "oclif": {
    "hooks": {
      "b2c:log-redaction": "./dist/hooks/log-redaction.js"
    }
  }
}
```

## Example

```typescript
import type { LogRedactionHook } from '@salesforce/b2c-tooling-sdk/cli';
import { deepLogRedactor } from '@salesforce/b2c-tooling-sdk/logging';

const hook: LogRedactionHook = async function() {
  return { redactors: [deepLogRedactor] };
};

export default hook;
```
