Boost C++ Libraries: Ticket #10926: Process ID insertion operator not internal filled https://svn.boost.org/trac10/ticket/10926 <p> Process ID is formatted with <em>leading</em> 0's rather than internal 0's (thread ID is okay). This results in a log entry like this: </p> <pre class="wiki">13:25:26.014303 DEBUG [000000x9b8/0x00000914] Gsid.cpp(302):MakeXfer &gt; Start main </pre><p> whereas it should look like this: </p> <pre class="wiki">13:25:26.014303 DEBUG [0x000009b8/0x00000914] Gsid.cpp(302):MakeXfer &gt; Start main </pre><p> ...based on the following unsurprising code snippet. </p> <pre class="wiki">logging::add_file_log ( LogFile(), keywords::open_mode = std::ios::out | std::ios::app, keywords::filter = expr::attr&lt;severity_level&gt;("Severity") &gt;= MinSeverity, keywords::rotation_size = MaxFileSize, keywords::max_size = MaxFileSize * MaxBackupIndex, keywords::format = expr::stream &lt;&lt; expr::format_date_time&lt;boost::posix_time::ptime&gt;("TimeStamp", TimestampFormat()) &lt;&lt; " " &lt;&lt; expr::attr&lt;severity_level&gt;("Severity") &lt;&lt; " [" &lt;&lt; expr::attr&lt;attrs::current_process_id::value_type&gt;("ProcessID") &lt;&lt; "/" &lt;&lt; expr::attr&lt;attrs::current_thread_id::value_type&gt;("ThreadID") &lt;&lt; "] " &lt;&lt; expr::format_named_scope("Scope", keywords::format = ScopeFormat()) &lt;&lt; " &gt; " &lt;&lt; expr::message ); boost::shared_ptr&lt;logging::core&gt; pCore = logging::core::get(); pCore-&gt;add_global_attribute( aux::default_attribute_names::timestamp(), attrs::local_clock()); pCore-&gt;add_global_attribute( aux::default_attribute_names::process_id(), attrs::current_process_id()); pCore-&gt;add_global_attribute("ProcessName", attrs::current_process_name()); pCore-&gt;add_global_attribute( aux::default_attribute_names::thread_id(), attrs::current_thread_id()); pCore-&gt;add_global_attribute("Scope", attrs::named_scope()); </pre><p> I believe the fix is to replace this line in libs/log/src/process_id.cpp: </p> <pre class="wiki">io::ios_flags_saver flags_saver(strm, std::ios_base::hex | std::ios_base::showbase); </pre><p> with this line: </p> <pre class="wiki">io::ios_flags_saver flags_saver(strm, std::ios_base::hex | std::ios_base::internal | std::ios_base::showbase); </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10926 Trac 1.4.3 Andrey Semashev Sun, 25 Jan 2015 15:15:40 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/10926#comment:1 https://svn.boost.org/trac10/ticket/10926#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Should be fixed in <a class="ext-link" href="https://github.com/boostorg/log/commit/59f5bcdcadb13019b29482eb55814e89a823f478"><span class="icon">​</span>https://github.com/boostorg/log/commit/59f5bcdcadb13019b29482eb55814e89a823f478</a>. </p> <p> Thanks for the report. </p> Ticket