# How to subscribe to/redirect log messages?

**URL:** <https://forums.unrealengine.com/t/how-to-subscribe-to-redirect-log-messages/354561>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 18, 2016, 7:02am UTC](https://forums.unrealengine.com/t/how-to-subscribe-to-redirect-log-messages/354561 "2016-04-18T07:02:02Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Shen\_Yuju](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shen\_Yuju](https://forums.unrealengine.com/u/Shen_Yuju)\
**Post date:** [November 15, 2023, 8:30pm UTC](https://forums.unrealengine.com/t/how-to-subscribe-to-redirect-log-messages/354561/8 "2023-11-15T20:30:31Z")

</div>

thanks alot for bringing up this question, and for UE5, it can be done in a very easy way:

```auto
FStringOutputDevice OutputDevice;
FOutputDeviceRedirector::Get()->AddOutputDevice(&OutputDevice);
// call the log functions
FOutputDeviceRedirector::Get()->RemoveOutputDevice(&OutputDevice);
UE_LOG(LogTemp, Display, TEXT("the captured log is: %s"), *OutputDevice);

```

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-subscribe-to-redirect-log-messages/354561)._
