---
title: set_panic_endpoint
summary: Set the logging endpoint where the message from Rust panics will be written.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/log/fn.set_panic_endpoint/
---

**Kind:** Function  
**Module:** [log](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/log/)  
**Package:** fastly 0.13.1  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#197

```rust
fn set_panic_endpoint<E>(endpoint: E) -> Result<(), LogError>
where
    E: TryInto<Endpoint, Error = LogError>,
```

Set the logging endpoint where the message from Rust panics will be written.

By default, panic output is written to the `stderr` endpoint. Calling this function will
override that default with the endpoint, which may be provided as a string or an
[`Endpoint`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/log/struct.Endpoint/).

```rust
fastly::log::set_panic_endpoint("my_error_endpoint")?;
panic!("oh no!");
// will log "panicked at 'oh no', your/file.rs:line:col" to "my_error_endpoint"
}
```

**Parameters**

- `endpoint`: `E`

**Returns**

`Result<(), LogError>`
