<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/zephyr-logging-subsystem-best-practices-for-performance-vw0huckdl" -->

---
title: Zephyr Logging Subsystem: Best Practices for Performance
description: Configuring the Zephyr logging subsystem correctly can mean the difference between a 4.61ms caller delay and a 5 microsecond one. On the NXP FRDM-MCXN947...
canonical: https://daily.dev/posts/zephyr-logging-subsystem-best-practices-for-performance-vw0huckdl
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Zephyr Logging Subsystem: Best Practices for Performance | daily.dev
og:description: Configuring the Zephyr logging subsystem correctly can mean the difference between a 4.61ms caller delay and a 5 microsecond one. On the NXP FRDM-MCXN947...
og:url: https://daily.dev/posts/zephyr-logging-subsystem-best-practices-for-performance-vw0huckdl
og:image: https://api.daily.dev/og/posts/vW0HuCkDL.png
og:image:alt: Zephyr Logging Subsystem: Best Practices for Performance
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Zephyr Logging Subsystem: Best Practices for Performance

**[Beningo Embedded Group](https://daily.dev/sources/beningo)** · 25 min read · 0 upvotes · 0 comments

## Summary

Configuring the Zephyr logging subsystem correctly can mean the difference between a 4.61ms caller delay and a 5 microsecond one. On the NXP FRDM-MCXN947 (Cortex-M33 at 150MHz, Zephyr 4.4.2), immediate-mode UART logging blocked the caller for 4.61ms per message, while deferred mode returned in about 5 microseconds. But deferred mode still cost 281ms of processing-thread CPU time for 64 messages and added a 4096-byte buffer plus a 2048-byte stack. At 400 messages per second, UART delivered only 39% of messages while RTT delivered them all. Compile-time filtering removes debug calls entirely, while runtime filtering keeps them compiled in with extra overhead.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.beningo.com/zephyr-logging-subsystem-best-practices>

## Questions this post answers

### What is the difference between deferred and immediate logging modes in Zephyr RTOS?

Deferred logging packages accepted messages into a RAM buffer so a processing thread formats and outputs them later, letting the caller return quickly. Immediate logging formats and sends output before the call returns, blocking the caller. On an FRDM-MCXN947 running Zephyr 4.4.2 at 150MHz, immediate UART logging took about 4.61ms per call versus about 5 microseconds for deferred mode.

_Weighing caller latency against CPU budget comes up often on daily.dev for embedded logging decisions._

### How much RAM and flash does enabling deferred logging add in Zephyr?

Deferred UART logging added about 8,416 bytes of flash and 6,496 bytes of RAM compared to a baseline with logging disabled, measured on Zephyr 4.4.2 with GCC 14.3.0 and size optimization (-Os) on a Cortex-M33 at 150MHz. Adding runtime filtering increased this slightly to 9,440 bytes flash and 6,552 bytes RAM.

_Budgeting flash and RAM for logging tradeoffs is exactly the kind of detail worth tracking on daily.dev._

### Can a UART logging backend keep up with high message rates in Zephyr?

Not necessarily. At a requested rate of 400 messages per second on an FRDM-MCXN947, a deferred UART backend delivered only about 39% of messages across a full run, while an RTT backend read through the onboard CMSIS-DAP probe via OpenOCD delivered all of them at the same sustained rate, showing the transport, not just the buffer size, determines throughput.

_Choosing the right logging backend for throughput needs is a recurring decision developers track on daily.dev._

## Similar posts on daily.dev

- [Simplifying Embedded System Design with a Modern Software Ecosystem](https://daily.dev/posts/simplifying-embedded-system-design-with-a-modern-software-ecosystem-jr0ummxbk) · Embedded.com · 0 upvotes · 0 comments
- [RTOS Benchmark Study 2026: Now Available](https://daily.dev/posts/rtos-benchmark-study-2026-now-available-rms44kaqc) · Beningo Embedded Group · 0 upvotes · 0 comments
- [Zephyr at 10: A Decade of Open Source Embedded Innovation](https://daily.dev/posts/zephyr-at-10-a-decade-of-open-source-embedded-innovation-vibqu9lw9) · Linux Foundation · 0 upvotes · 0 comments
- [ESP32-C6 power consumption: Arduino vs Zephyr vs ESP-IDF comparison](https://daily.dev/posts/esp32-c6-power-consumption-arduino-vs-zephyr-vs-esp-idf-comparison-kyu9tbetr) · Hacker News · 0 upvotes · 0 comments
- [My device crashed in the field. How do I figure out why?](https://daily.dev/posts/my-device-crashed-in-the-field-how-do-i-figure-out-why--kaigqs2zu) · EmbeddedRelated · 0 upvotes · 0 comments

---

Tags: [#logging](https://daily.dev/tags/logging), [#embedded](https://daily.dev/tags/embedded), [#rtos](https://daily.dev/tags/rtos)

[View this post on daily.dev](https://daily.dev/posts/zephyr-logging-subsystem-best-practices-for-performance-vw0huckdl)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Zephyr Logging Subsystem: Best Practices for Performance","url":"https://daily.dev/posts/zephyr-logging-subsystem-best-practices-for-performance-vw0huckdl","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/zephyr-logging-subsystem-best-practices-for-performance-vw0huckdl"},"datePublished":"2026-10-29T18:08:53.970Z","dateModified":"2026-10-29T18:10:09.042Z","description":"Configuring the Zephyr logging subsystem correctly can mean the difference between a 4.61ms caller delay and a 5 microsecond one. On the NXP FRDM-MCXN947...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6eb2b02cb5f3ceb45f22b1d85f47a1a5?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6eb2b02cb5f3ceb45f22b1d85f47a1a5?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Beningo Embedded Group","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Beningo Embedded Group","logo":"https://media.daily.dev/image/upload/s--QAVHp2D0--/f_auto,q_auto/v1780213544/logos/beningo?_a=BAMAMiWQ0","url":"https://daily.dev/sources/beningo"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/zephyr-logging-subsystem-best-practices-for-performance-vw0huckdl","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"logging,embedded,rtos","timeRequired":"PT25M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Beningo Embedded Group","item":"https://daily.dev/sources/beningo"},{"@type":"ListItem","position":3,"name":"Zephyr Logging Subsystem: Best Practices for Performance"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/zephyr-logging-subsystem-best-practices-for-performance-vw0huckdl#faq","mainEntity":[{"@type":"Question","name":"What is the difference between deferred and immediate logging modes in Zephyr RTOS?","acceptedAnswer":{"@type":"Answer","text":"Deferred logging packages accepted messages into a RAM buffer so a processing thread formats and outputs them later, letting the caller return quickly. Immediate logging formats and sends output before the call returns, blocking the caller. On an FRDM-MCXN947 running Zephyr 4.4.2 at 150MHz, immediate UART logging took about 4.61ms per call versus about 5 microseconds for deferred mode. Weighing caller latency against CPU budget comes up often on daily.dev for embedded logging decisions."}},{"@type":"Question","name":"How much RAM and flash does enabling deferred logging add in Zephyr?","acceptedAnswer":{"@type":"Answer","text":"Deferred UART logging added about 8,416 bytes of flash and 6,496 bytes of RAM compared to a baseline with logging disabled, measured on Zephyr 4.4.2 with GCC 14.3.0 and size optimization (-Os) on a Cortex-M33 at 150MHz. Adding runtime filtering increased this slightly to 9,440 bytes flash and 6,552 bytes RAM. Budgeting flash and RAM for logging tradeoffs is exactly the kind of detail worth tracking on daily.dev."}},{"@type":"Question","name":"Can a UART logging backend keep up with high message rates in Zephyr?","acceptedAnswer":{"@type":"Answer","text":"Not necessarily. At a requested rate of 400 messages per second on an FRDM-MCXN947, a deferred UART backend delivered only about 39% of messages across a full run, while an RTT backend read through the onboard CMSIS-DAP probe via OpenOCD delivered all of them at the same sustained rate, showing the transport, not just the buffer size, determines throughput. Choosing the right logging backend for throughput needs is a recurring decision developers track on daily.dev."}}]}
```

