Challenge getting logging going via QOS file

4 posts / 0 new
Last post
Offline
Last seen: 4 years 6 months ago
Joined: 01/07/2016
Posts: 2
Challenge getting logging going via QOS file
AttachmentSize
File MyQosFile671 bytes

I'm working to debug and extend some legacy code and now need to kick up the debug output from the RTI DDS stuff.  I thought it would be easy.  :-)

The existing code relies only on the default QOS settings that are compiled into RTI.  I created a small QOS file (XYZ_QOS.xml, as shown below) and pointed to it via the NDDS_QOS_PROFILES environment variable.  I can confirm that the file is being read two separate ways...

  1. If I introduce a syntax error to the file, it complains royally.  :-)
  2. The program succeeds in making the output file when it runs!

Unfortunately, even though I get a log file, it's zero length and never receives any logging info.  Other than that, the program runs as before, so I don't appear to have broken anything.

I have to believe I'm forgetting something simple.  Any thoughts?

<?xml version="1.0"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="rti_dds_qos_profiles.xsd"
    version="5.1.0">
  <qos_library name="BuiltinQosLib">
    <qos_profile name="RTI Logger" is_default_participant_factory_profile = "true" >
      <participant_factory_qos>
        <logging>
          <verbosity>    STATUS_ALL  </verbosity>
          <category>     ALL         </category>
          <print_format> TIMESTAMPED </print_format>
          <output_file>  rti_xyz.log </output_file>
        </logging>
      </participant_factory_qos>
    </qos_profile>
  </qos_library>
</dds>

 

Gerardo Pardo's picture
Offline
Last seen: 3 weeks 2 days ago
Joined: 06/02/2010
Posts: 592

It may be that the logs are being buffered and not being flushed to disk.

Are you terminating your program gracefully? Are you calling:

// This should be called on all DomainParticipants
participant->delete_contained_entities();
TheParticipantFactory->delete_participant(participant);

// This should be called after the DomainParticipants have been deleted
TheParticipantFactory->finalize_instance();
 

Gerardo

Offline
Last seen: 2 years 9 months ago
Joined: 09/17/2015
Posts: 53

How does it work with the C++11 API. I tried this settings but they have no effects. But of course I am not using the DomainParticipant Factory. But we use the XML Application Profile to create the Participants as you can see in our config file. Where do I need to add the logging settings?

<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="/opt/rti_connext_dds-5.2.0/resource/schema/rti_dds_profiles.xsd"
version="5.2.0">

<!-- QoS Library containing the QoS profile used in the generated example. A
QoS library is a named set of QoS profiles. -->
<qos_library name="profiles">

<!-- A QoS profile groups a set of related QoS. This QoS profile used to
configure reliable communication between the DataWriter and DataReader
created in the example code. Durability is set to Volatile (default
configuration), so late-joiner subscribers won't get samples sent by
DataWriters in the past. -->
<qos_profile name="default" is_default_qos="true">

<datawriter_qos>
<property>
<value>cd
<!-- The next setting is used to force dynamic memory allocation for
samples with a serialized size of larger than 32K. Without
setting pool_buffer_max_size, all memory would be obtained from a
pre-allocated pool, which would greatly increase the memory usage
in an application that sends large data. -->
<element>
<name>dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size</name>
<value>32768</value>
</element>
</value>
</property>
</datawriter_qos>

<datareader_qos>
<reader_resource_limits>
<!-- Determines whether the DataReader pre-allocates storage for
storing fragmented samples. This setting can be used to limit
up-front memory allocation costs in applications that deal with
large data -->
<dynamically_allocate_fragmented_samples>true</dynamically_allocate_fragmented_samples>
</reader_resource_limits>
<property>
<value>
<!-- The next setting is used to force dynamic memory allocation for
samples with a serialized size of larger than 32K. Without
setting pool_buffer_max_size, all memory would be obtained from
a pre-allocated pool, which would greatly increase the memory
usage in an application that sends large data. -->
<element>
<name>dds.data_reader.history.memory_manager.fast_pool.pool_buffer_max_size</name>
<value>32768</value>
</element>
</value>
</property>
</datareader_qos>

</qos_profile>
</qos_library>

<!-- Domain Library -->
<domain_library name="Domain_Library">
<!-- Set here the domain id used by the dds factory -->
<domain name="${DOMAIN_NAME}" domain_id="${DOMAIN_ID}">
</domain>
</domain_library>

<!-- Participant library -->
<participant_library name="Participant_Library">
<domain_participant name="Participant"
domain_ref="Domain_Library::${DOMAIN_NAME}">
</domain_participant>
</participant_library>
</dds>

 

Offline
Last seen: 4 years 6 months ago
Joined: 01/07/2016
Posts: 2

Gerardo,

Sorry for the very late reply.  I think you may very well be correct about the termination.  The program is designed to never actually 'end'... it just keeps running.  We do catch ^C and do some shut down from there.  I'll see if we can add the code you suggest into that section.

Thanks