# Taking action based on Log Level

**URL:** <https://discourse.julialang.org/t/taking-action-based-on-log-level/47951>\
**Category:** General Usage\
**Tags:** logging\
**Created:** [October 7, 2020, 6:53pm UTC](https://discourse.julialang.org/t/taking-action-based-on-log-level/47951 "2020-10-07T18:53:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmalham](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@bmalham](https://discourse.julialang.org/u/bmalham)\
**Post date:** [October 7, 2020, 6:53pm UTC](https://discourse.julialang.org/t/taking-action-based-on-log-level/47951/1 "2020-10-07T18:53:43Z")

</div>

Hello,

What is the best way to take action based on log level? For example if I wanted to write the output from all log levels to a text file, but I also wanted to print any @err messages to stdout, what would be the best way to do that? Based on the Julia documentation it seems like the solution has something to do with the ‘handle\_message’ function, but I couldn’t find any examples and couldn’t quite figure out how to do it.

Thanks for the help.
