Hello all!
First time posting, tried to search for answer but couldn't find anything, sorry if this is a duplicate.
I have tried the following setps mentioned in https://community.rti.com/kb/enabling-logging-xml-qos-file to set the logging for the publisher but this is unclear how to read the log file in c++ and set the attributes.
Could you please so kind to share some example program to understand better on, how to read the xml file and how to set the log attributes?
The binary execution
./HelloWorldExample
Error:
2021-06-30 22:49:40.537 [XMLPARSER Error] Not expected tag: 'qos_library' -> Function parseXML
Cannot open XML file
Publisher found
2021-06-30 22:49:40.537 [XMLPARSER Error] Error parsing 'log.xml' -> Function loadXMLFile
Attachment | Size |
---|---|
log.xml | 1.1 KB |
The XML file that you attached worked for me. LoggerOutput2.txt was created.
Are you sure your application is loading the log.xml file and not some other?
Also, I note that you have 2 profiles in the XML that have been set as is_default_participant_factory_profile ="true".
That's not a great idea as it's ambiguous as to which one you want to be used as the default participant factory profile. I suggest removing one.
Hello Howard,
Thanks a lot for your response. Is it possible to get the code snippet, which you have used for testing it?
I have tried but facing the error like "2021-06-30 22:49:40.537 [XMLPARSER Error] Not expected tag: 'qos_library' -> Function parseXML", DId I missed some installation ? and possible to get your code part ?
Uh, there is no code to get. I just ran it with a HelloWorld. Any helloworld should be able to run with this.
Are you sure that it's loading the file you're expecting it to load? How are you specifying "log.xml" as an XML file to load?
Also, there should be error messages that direct you to the line number in the XML file where the problem is found. Does the line number correspond to the one in "log.xml"?
Hi,
I have used the below snipped of the code and not sure this is the correct API to use it and could not find the info which API shall be used.
ugeshmunirajulu@ubuntu20:~/DDS/DDS_Git/DDS_HandsOn/HelloWorldExample/build$ ./HelloWorldExample
2021-06-30 22:49:40.537 [XMLPARSER Error] Not expected tag: 'qos_library' -> Function parseXML
Cannot open XML file
Publisher found
2021-06-30 22:49:40.537 [XMLPARSER Error] Error parsing 'log.xml' -> Function loadXMLFile
Please kindly check the highlighted lines
No, you can't do that.
The DomainPartipantFactory automatically loads or can be configured to load XML files.
Please read through this documentation:
https://community.rti.com/static/documentation/connext-dds/6.1.0/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/How_to_Load_XML_Specified_QoS_Settings.htm#xmlconfiguration_1275484337_316960%3FTocPath%3DPart%25203%253A%2520Advanced%2520Concepts%7C19.%2520Configuring%2520QoS%2520with%2520XML%7C19.5%2520How%2520to%2520Load%2520XML-Specified%2520QoS%2520Settings%7C_____0
Hi Howard,
sorry again, I could not able to get the info from the link,are you refering the below ?
So, if you want to directly configure your app to load specific files in code, then sure, what you have is fine, except that you need to use "file:///usr/ ...", 3 slashes.
But as discussed on the page that I sent you:
https://community.rti.com/static/documentation/connext-dds/6.1.0/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/How_to_Load_XML_Specified_QoS_Settings.htm#xmlconfiguration_1275484337_316960%3FTocPath%3DPart%25203%253A%2520Advanced%2520Concepts%7C19.%2520Configuring%2520QoS%2520with%2520XML%7C19.5%2520How%2520to%2520Load%2520XML-Specified%2520QoS%2520Settings%7C_____0
Connext DDS will automatically load files as well use files specified in an environment variable:
Listed in load order:
This file is loaded automatically if it exists (not the default) and ignore_resource_profile in the 9.4.2 PROFILE QosPolicy (DDS Extension) is FALSE (the default). NDDS_QOS_PROFILES.xml does not exist by default. However, NDDS_QOS_PROFILES.example.xml is shipped with the host bundle of the product; you can copy it to NDDS_QOS_PROFILES.xml and modify it for your own use. The file contains the default QoS values that will be used for all entity kinds. (First to be loaded)
One or more XML files separated by semicolons referenced by the environment variable NDDS_QOS_PROFILES are loaded automatically if they exist and ignore_environment_profile in 9.4.2 PROFILE QosPolicy (DDS Extension) is FALSE (the default).
Semicolons indicate to Connext DDS to load multiple files or strings all at once. For example:
On Linux and macOS systems, with bash:
From a Windows command prompt:
This file is loaded automatically if it exists and ignore_user_profile in 9.4.2 PROFILE QosPolicy (DDS Extension) is FALSE (the default).
One or more XML files referenced by url_profile (in 9.4.2 PROFILE QosPolicy (DDS Extension) ) will be loaded automatically if specified.
The sequence of XML strings referenced by string_profile (in 9.4.2 PROFILE QosPolicy (DDS Extension) ) will be loaded automatically if specified. See 19.7 XML String Syntax. (Last to be loaded)
Note: The url_profile and string_profile fields are useful for adding profiles programmatically, when you do not want to use an environment variable.