<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Redirect nrf5340 LOG to custom user function</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103048/redirect-nrf5340-log-to-custom-user-function</link><description>Hello, 
 I want to redirect the LOG of nrf5340 into my custom function for saving it into microSD, sending via USB etc. 
 How can I get it into a custom function? Currently I am printing it via RTT.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Oct 2023 12:07:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103048/redirect-nrf5340-log-to-custom-user-function" /><item><title>RE: Redirect nrf5340 LOG to custom user function</title><link>https://devzone.nordicsemi.com/thread/450830?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2023 12:07:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:044dfbf6-9b68-4235-b58c-6b530ba0e866</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi, very sorry for the wait&lt;/p&gt;
&lt;p&gt;I believe the best way to do this would be to disable CONFIG_LOG_BACKEND_RTT, and create your own backend using your functions and LOG_BACKEND_DEFINE()&lt;/p&gt;
&lt;p&gt;To see how this is done, read the Backends section of the documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/logging/index.html#logging-backends"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/logging/index.html#logging-backends&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You might also find it useful to have a look at how the existing backends are implemented:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/logging/backends/log_backend_uart.c"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/logging/backends/log_backend_uart.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/logging/backends/Kconfig.uart"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/logging/backends/Kconfig.uart&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Redirect nrf5340 LOG to custom user function</title><link>https://devzone.nordicsemi.com/thread/442740?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 10:45:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:017533c2-3d8c-41ab-937a-5ff4f7ecd160</guid><dc:creator>vinodsdw</dc:creator><description>&lt;p&gt;Yes, everything I need to redirect to my custom varg function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Redirect nrf5340 LOG to custom user function</title><link>https://devzone.nordicsemi.com/thread/442739?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 10:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc0e5ae9-2a6f-4d43-bc0c-8479ba977319</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you mean the log from the application or the log from the entire system? ie. every enabled call to LOG_INF(), LOG_ERR() etc. Do you want calls to printk() to also be included?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>