---
schema_version: "1"
id: 911bb3e83c8ba095b70653cd350f02b20539b946960d998f130b178bd1cfd55e
title: logWith
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-core-functions-logwith.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-core-functions-logwith
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b220f1691faafb5f031d17ea83c3bd4495a6f52dcb82e6107ce8c70bd135f8aa
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# logWith

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## logWith<T>(level: LogLevel, prefix: String, value: T): T

Without changing the value of the input, `logWith` returns the input as a system log at the
specified level. This makes it simple to debug your code, because any expression or subexpression
can be wrapped with **log** and the result is printed out without modifying the result of the
expression. The output is printed in application/dw format.

The prefix parameter is optional and allows finding the log output easily.

Use the `LogLevel` to categorize log events by severity and control the verbosity of the logs.

Use this function to help with debugging DataWeave scripts. A Mule app outputs the results through
the `DefaultLoggingService`, which you can see in the Studio console.

_Introduced in DataWeave version 2.10.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>level</code></p></td><td><p>Log level that indicates the severity of the event.</p></td></tr><tr><td><p><code>prefix</code></p></td><td><p>An optional string that typically describes the log.</p></td></tr><tr><td><p><code>value</code></p></td><td><p>The value to log.</p></td></tr></tbody></table>
