<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[logging to different files via qInstallMessageHandler]]></title><description><![CDATA[<p dir="auto">Hi!<br />
I need to store logs in a different files in one app.<br />
Is it possible to add some tag to 'log' method?</p>
<p dir="auto">I see <strong>qInstallMessageHandler</strong> has a fixed input parameters.</p>
]]></description><link>https://forum.qt.io/topic/158196/logging-to-different-files-via-qinstallmessagehandler</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 11:59:51 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/158196.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Aug 2024 12:49:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to logging to different files via qInstallMessageHandler on Tue, 13 Aug 2024 14:15:28 GMT]]></title><description><![CDATA[<p dir="auto">Then filter by a keyword in the text. I don't see that your usecase could be handled easier with other logging systems...</p>
]]></description><link>https://forum.qt.io/post/807238</link><guid isPermaLink="true">https://forum.qt.io/post/807238</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 13 Aug 2024 14:15:28 GMT</pubDate></item><item><title><![CDATA[Reply to logging to different files via qInstallMessageHandler on Tue, 13 Aug 2024 14:10:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> said in <a href="/post/807232">logging to different files via qInstallMessageHandler</a>:</p>
<blockquote>
<p dir="auto">As <a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> already told you - the category is the tag where you can filter on.</p>
</blockquote>
<p dir="auto">Your advice is to detect which exactly QFile will store a log by log category?</p>
<p dir="auto">Very strange advice in my case... This assumes to 10 various log categories for 10 subclasses of MDI app.</p>
]]></description><link>https://forum.qt.io/post/807235</link><guid isPermaLink="true">https://forum.qt.io/post/807235</guid><dc:creator><![CDATA[sitesv]]></dc:creator><pubDate>Tue, 13 Aug 2024 14:10:38 GMT</pubDate></item><item><title><![CDATA[Reply to logging to different files via qInstallMessageHandler on Tue, 13 Aug 2024 13:58:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sitesv">@<bdi>sitesv</bdi></a> said in <a href="/post/807219">logging to different files via qInstallMessageHandler</a>:</p>
<blockquote>
<p dir="auto">Is it possible to add some tag to 'log' method?</p>
</blockquote>
<p dir="auto">As <a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> already told you - the category is the tag where you can filter on.</p>
]]></description><link>https://forum.qt.io/post/807232</link><guid isPermaLink="true">https://forum.qt.io/post/807232</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 13 Aug 2024 13:58:29 GMT</pubDate></item><item><title><![CDATA[Reply to logging to different files via qInstallMessageHandler on Tue, 13 Aug 2024 13:52:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> said in <a href="/post/807227">logging to different files via qInstallMessageHandler</a>:</p>
<blockquote>
<p dir="auto">If you are you using your own logging messages see QLoggingCategory Class for creating your own categories and what you can do with them.</p>
</blockquote>
<p dir="auto">The problem is a storing in the various files, not a creation my own category.</p>
<p dir="auto">The target QFile is used in messageHandler only.</p>
]]></description><link>https://forum.qt.io/post/807231</link><guid isPermaLink="true">https://forum.qt.io/post/807231</guid><dc:creator><![CDATA[sitesv]]></dc:creator><pubDate>Tue, 13 Aug 2024 13:52:14 GMT</pubDate></item><item><title><![CDATA[Reply to logging to different files via qInstallMessageHandler on Tue, 13 Aug 2024 13:32:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sitesv">@<bdi>sitesv</bdi></a><br />
<a href="https://doc.qt.io/qt-5/qtglobal.html#QtMessageHandler-typedef" target="_blank" rel="noopener noreferrer nofollow ugc">typedef QtMessageHandler</a></p>
<blockquote>
<p dir="auto"><code>void myMessageHandler(QtMsgType, const QMessageLogContext &amp;, const QString &amp;);</code></p>
</blockquote>
<p dir="auto">You cannot change/add to those parameters.  The message type &amp; context are set for <code>qDebug()</code> and other inbuilt callers, you cannot use those to pass extra information.</p>
<p dir="auto">If you are you using your own logging messages see <a href="https://doc.qt.io/qt-6/qloggingcategory.html" target="_blank" rel="noopener noreferrer nofollow ugc">QLoggingCategory Class</a> for creating your own categories and what you can do with them.</p>
]]></description><link>https://forum.qt.io/post/807227</link><guid isPermaLink="true">https://forum.qt.io/post/807227</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 13 Aug 2024 13:32:37 GMT</pubDate></item></channel></rss>