Hello tangoers,
reading the tango doc on Logging, I made a few tests and have a few questions:
Logging properties for Starter should be set in jive in Device tab, and then in dserver/Starter/COMPUTERNAME and not in Starter/COMPUTERNAME/Starter then tango/admin/COMPUTERNAME
Am I right ?
If not, when should we add Logging properties into dserver or Starter (and more generally, into DeviceServerName) ?
If yes, this could be confusing, but I did not find anything on it into the doc
I did not really find anything on Current logging level and Current logging target properties.
[quote=“philippeg”]Hello tangoers,
reading the tango doc on Logging, I made a few tests and have a few questions:
Logging properties for Starter should be set in jive in Device tab, and then in dserver/Starter/COMPUTERNAME and not in Starter/COMPUTERNAME/Starter then tango/admin/COMPUTERNAME
Am I right ?
[/quote]
That does not sound right to me. How did you come to this conclusion from your tests?
If you want to get some logging about what’s going on in the cppTango library, you indeed need to enable the logs in DEBUG level on the admin device, this is where you’ll get the logs coming from the cpptango library. The logs specific to the device of the Starter class (logs from the Starter class code) should be in the logs configured for tango/admin/COMPUTERNAME device.
[quote=“philippeg”]
If not, when should we add Logging properties into dserver or Starter (and more generally, into DeviceServerName) ?[/quote]
You add logging properties for the dserver (admin) device if you want to see what’s going on with the admin device or if you want to see the logs coming from the cppTango library (you have to be in DEBUG mode to see these logs and they will be associated to dserver/Starter/COMPUTERNAME device).
You add logging properties for the Starter device (tango/admin/COMPUTERNAME) if you want to see the logs coming from the Starter class code.
[quote=“philippeg”]
2. I did not really find anything on Current logging level and Current logging target properties.
Did I miss something into the doc?
Regards[/quote]
Maybe it’s not in the doc. The doc can always be improved. Many thanks for all the doc improvements suggestions you made by the way.
The Current logging level corresponds to the current logging level (Surprise! ). If you change it, it will change the current logging level for the associated device but if the device (or device server) is restarted, the current logging level will be reset to the value in logging level property.
Same principle for the Current logging target, this affects only the current logging target for the current session. If you restart your device or device server, this will be lost and the logging target property will be used to set the logging target during the device server initialization.
So basically, as far as I have understood, the Current logging xxx properties are just temporary properties which will be lost/overwritten at the next restart of the device or device server.
I think they are not even real properties but jive provide this as a way to change the current logging level and current logging target but the Current logging xxx are not saved in the Tango Database. logging target and logging level properties are the ones used to configure the logging during the device initialization in a persistent way.
Sorry, I probably misunderstood the behaviour while looking at the upcase bug.
[quote=“Reynald”]
So basically, as far as I have understood, the Current logging xxx properties are just temporary properties which will be lost/overwritten at the next restart of the device or device server.
I think they are not even real properties but jive provide this as a way to change the current logging level and current logging target but the Current logging xxx are not saved in the Tango Database. logging target and logging level properties are the ones used to configure the logging during the device initialization in a persistent way.[/quote]
It’s interesting, thank you for those details.
I understand that “Current logging…” is more a read-only property for information, and that if it is modified while the device is running, it will not modify the way logging will be done for this session.
[quote=“philippeg”]I understand that “Current logging…” is more a read-only property for information, and that if it is modified while the device is running, it will not modify the way logging will be done for this session.
Am I right? [/quote]
No. Sorry. If you modify the current logging … properties in jive, it will modify the logging for the current session but these new logging parameters will be lost if the device server/device is restarted.
[quote=“Reynald”][quote=“philippeg”]I understand that “Current logging…” is more a read-only property for information, and that if it is modified while the device is running, it will not modify the way logging will be done for this session.
Am I right? [/quote]
No. Sorry. If you modify the current logging … properties in jive, it will modify the logging for the current session but these new logging parameters will be lost if the device server/device is restarted.[/quote]
Don’t be sorry, it allows me to better understand.
So it allows to dynamically modify the logging behaviour for current session, even better
Will try to add some details into the doc on this topic.
I cannot explain what you’re seeing but I can see the same behaviour with the first tests I’ve done with the DatabaseDS.
This device server is really special so there might be some hard coded values for the logging of this DS?
If you consider this as an issue that you would like to be solved, please create an issue on the TangoDatabase gitlab repository.
Hi Reynald,
thank you for this detailed answer.
It’s interesting to understand the behaviour and it does not need an issue in my opinion.
I’ll thnik about it if it needs a doc evolve and if I can make a merge request.
in TdbArchiver (ArchivingRoot device), I defined Logging_target to file::/tmp/tango-tango/tdbarchiver/01/01.log.
However, it writes its login another directory (/var/archivage/tdb/01 defined in dsPath, dbPath and diaryPath).
logging_target property is a Tango system property. (you see it in jive in your device properties only if Edit menu → Show system property is ticked).
This is a property which can be defined for any Tango device.
When you change the “Logging target” on the “Logging” node of your device in jive, this will write this “logging_target” system property for your device in the Tango Database.
So “logging_target” is a Tango specific system device property, not specific to the TdbArchiver.
dsPath and dbPath are probably some TdbArchiver device properties and are probably specific to the tdbArchiver class.
You should probably refer to tdbArchiver class documentation to get more details about what these properties are doing.
Thank you for your fast & detailed answer Reynald, this is always interesting (and happy new year)
I just ticked Show system property, but after a few tests, I saw the Logging_target property whatever the “Show system property” is ticked or not (however, the device is stopped).
It is not in the ArchivingRoot doc, but I’ll contact development just in case…
[quote=“Reynald”]
Hoping this helps a bit.
Reynald[/quote]
Indeed, I didn’t noticed the “show system property” until now.
By chance, is it described somewhere in the doc?
A more general question: can “Logging_target” be rewritten by the device? I mean is it possible that whatever is the value of Logging_target, the content of logging file is written somewhere else by the device?
I think it is possible.
One can always invoke AddLoggingTarget command on the admin device when it is running to add a file logging target.
It can be done programmatically with the Tango::Logging::add_logging_target() methods as well I think.