diff --git a/nrf-sdk/components/libraries/log/src/nrf_log_frontend.c b/nrf-sdk/components/libraries/log/src/nrf_log_frontend.c
index ea962acb1..5e24dfab4 100644
--- a/nrf-sdk/components/libraries/log/src/nrf_log_frontend.c
+++ b/nrf-sdk/components/libraries/log/src/nrf_log_frontend.c
@@ -317,17 +317,7 @@ static bool invalid_packets_omit(nrf_log_header_t const * p_header, uint32_t * p
     bool ret = false;
     if (p_header->base.generic.in_progress == 1)
     {
-        switch (p_header->base.generic.type)
-        {
-        case HEADER_TYPE_STD:
-            *p_rd_idx += (HEADER_SIZE + p_header->base.std.nargs);
-            break;
-        case HEADER_TYPE_HEXDUMP:
-            *p_rd_idx += (HEADER_SIZE + p_header->base.hexdump.len);
-            break;
-        default:
-            break;
-        }
+        *p_rd_idx += HEADER_SIZE + p_header->base.in_progress.allocated_len;
         ret = true;
     }
     return ret;
@@ -424,12 +414,15 @@ static inline void std_header_set(uint32_t severity_mid,
         m_log_data.buffer[(wr_idx + 2) & mask] = m_log_data.timestamp_func();
     }
 
+    nrf_log_main_header_t std_header = { .raw = 0 };
+    std_header.std.severity    = severity_mid & NRF_LOG_LEVEL_MASK;
+    std_header.std.nargs       = nargs;
+    std_header.std.addr        = ((uint32_t)(p_str) & STD_ADDR_MASK);
+    std_header.std.type        = HEADER_TYPE_STD;
+    std_header.std.in_progress = 0;
+
     nrf_log_header_t * p_header    = (nrf_log_header_t *)&m_log_data.buffer[wr_idx & mask];
-    p_header->base.std.severity    = severity_mid & NRF_LOG_LEVEL_MASK;
-    p_header->base.std.nargs       = nargs;
-    p_header->base.std.addr        = ((uint32_t)(p_str) & STD_ADDR_MASK);
-    p_header->base.std.type        = HEADER_TYPE_STD;
-    p_header->base.std.in_progress = 0;
+    p_header->base.raw = std_header.raw;
 }
 
 /**
@@ -443,7 +436,7 @@ static inline void std_header_set(uint32_t severity_mid,
  * @return True if successful allocation, false otherwise.
  *
  */
-static inline bool buf_prealloc(uint32_t content_len, uint32_t * p_wr_idx, bool std)
+static inline bool buf_prealloc(uint32_t content_len, uint32_t * p_wr_idx)
 {
     uint32_t req_len = content_len + HEADER_SIZE;
     bool     ret            = true;
@@ -471,18 +464,8 @@ static inline bool buf_prealloc(uint32_t content_len, uint32_t * p_wr_idx, bool
         nrf_log_main_header_t invalid_header;
         invalid_header.raw = 0;
 
-        if (std)
-        {
-            invalid_header.std.type        = HEADER_TYPE_STD;
-            invalid_header.std.in_progress = 1;
-            invalid_header.std.nargs       = content_len;
-        }
-        else
-        {
-            invalid_header.hexdump.type = HEADER_TYPE_HEXDUMP;
-            invalid_header.hexdump.in_progress = 1;
-            invalid_header.hexdump.len = content_len;
-        }
+        invalid_header.in_progress.in_progress = 1;
+        invalid_header.in_progress.allocated_len = content_len;
 
         nrf_log_main_header_t * p_header =
                    (nrf_log_main_header_t *)&m_log_data.buffer[m_log_data.wr_idx & m_log_data.mask];
@@ -541,7 +524,7 @@ static inline void std_n(uint32_t           severity_mid,
     uint32_t mask   = m_log_data.mask;
     uint32_t wr_idx;
 
-    if (buf_prealloc(nargs, &wr_idx, true))
+    if (buf_prealloc(nargs, &wr_idx))
     {
         // Proceed only if buffer was successfully preallocated.
 
@@ -642,7 +625,7 @@ void nrf_log_frontend_hexdump(uint32_t           severity_mid,
     uint32_t mask   = m_log_data.mask;
 
     uint32_t wr_idx;
-    if (buf_prealloc(CEIL_DIV(length, sizeof(uint32_t)), &wr_idx, false))
+    if (buf_prealloc(CEIL_DIV(length, sizeof(uint32_t)), &wr_idx))
     {
         uint32_t header_wr_idx = wr_idx;
         wr_idx += HEADER_SIZE;
@@ -668,13 +651,15 @@ void nrf_log_frontend_hexdump(uint32_t           severity_mid,
         uint32_t dropped   = dropped_sat16_get();
         m_log_data.buffer[(header_wr_idx + 1) & mask] = module_id | (dropped << 16);
         //Header prepare
-        nrf_log_header_t * p_header = (nrf_log_header_t *)&m_log_data.buffer[header_wr_idx & mask];
-        p_header->base.hexdump.severity    = severity_mid & NRF_LOG_LEVEL_MASK;
-        p_header->base.hexdump.offset      = 0;
-        p_header->base.hexdump.len         = length;
-        p_header->base.hexdump.type        = HEADER_TYPE_HEXDUMP;
-        p_header->base.hexdump.in_progress = 0;
+        nrf_log_main_header_t hexdump_header = { .raw = 0 };
+        hexdump_header.hexdump.severity    = severity_mid & NRF_LOG_LEVEL_MASK;
+        hexdump_header.hexdump.offset      = 0;
+        hexdump_header.hexdump.len         = length;
+        hexdump_header.hexdump.type        = HEADER_TYPE_HEXDUMP;
+        hexdump_header.hexdump.in_progress = 0;
 
+        nrf_log_header_t * p_header = (nrf_log_header_t *)&m_log_data.buffer[header_wr_idx & mask];
+        p_header->base.raw = hexdump_header.raw;
 
 
     }
diff --git a/nrf-sdk/components/libraries/log/src/nrf_log_internal.h b/nrf-sdk/components/libraries/log/src/nrf_log_internal.h
index d71680b20..e1a03952c 100644
--- a/nrf-sdk/components/libraries/log/src/nrf_log_internal.h
+++ b/nrf-sdk/components/libraries/log/src/nrf_log_internal.h
@@ -362,15 +362,21 @@ extern _CONST nrf_log_module_const_data_t NRF_LOG_ITEM_DATA_CONST(NRF_LOG_MODULE
 
 typedef struct
 {
-    uint32_t type       : 2;
+    uint32_t in_progress  : 1;
+    uint32_t allocated_len: 31;
+} nrf_log_in_progress_header_t;
+
+typedef struct
+{
     uint32_t in_progress: 1;
+    uint32_t type       : 2;
     uint32_t data       : 29;
 } nrf_log_generic_header_t;
 
 typedef struct
 {
-    uint32_t type       : 2;
     uint32_t in_progress: 1;
+    uint32_t type       : 2;
     uint32_t severity   : 3;
     uint32_t nargs      : 4;
     uint32_t addr       : 22;
@@ -378,8 +384,8 @@ typedef struct
 
 typedef struct
 {
-    uint32_t type       : 2;
     uint32_t in_progress: 1;
+    uint32_t type       : 2;
     uint32_t severity   : 3;
     uint32_t offset     : 10;
     uint32_t reserved   : 6;
@@ -388,10 +394,11 @@ typedef struct
 
 typedef union
 {
-    nrf_log_generic_header_t generic;
-    nrf_log_std_header_t     std;
-    nrf_log_hexdump_header_t hexdump;
-    uint32_t                 raw;
+    nrf_log_in_progress_header_t in_progress;
+    nrf_log_generic_header_t     generic;
+    nrf_log_std_header_t         std;
+    nrf_log_hexdump_header_t     hexdump;
+    uint32_t                     raw;
 } nrf_log_main_header_t;
 
 typedef struct
