Tango DS default logging target

By default, on Linux, Tango DS log files are stored in /tmp/tango-<user>/<server-name>/<instance-name> e.g. /tmp/tango-tangosys/RaspberryPiIO/ALD-Valves/ald_io_raspberrypiio-01.log

But, for example, on Debian 9 the /tmp will be erased on the next system startup (yes, this behavior can be changed, but we would prefer to keep the default Debian 9 behavior)

These logging files are important to be preserved on the system restart.

We thought to actually change the logging target and put it somewhere under /var/log which seems to be the right place for log files.

Is there any way to change the default /tmp/… path so that when we configure in Jive the "Logging target" to "file" it automatically set the "Current logging target" to a different path.

If not, what about specifying it in /etc/tangorc as we can do it now for TANGO_HOST on Debian?
Hi,

I think you can use the TANGO_LOG_PATH environment variable as described in the doc:
https://tango-controls.readthedocs.io/en/latest/development/advanced/reference.html#tango-logging-service-tango-log-path

Cheers,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Great! This should work for us.

I simply missed this in the docs. Thanks!
I just tested it. The environment variable option works perfectly!

But I'm not able to set it via the configuration file. Neither via the local file ($HOME/.tangorc) nor via the global one (/etc/tangorc). Is anyone using it like this?

Hi,

I think indeed this TANGO_LOG_PATH environment variable does not seem to be supported in tangorc files.
When looking at the code (https://github.com/tango-controls/cppTango/blob/tango-9-lts/cppapi/server/logging.cpp#L117) , it seems there is a simple call to ::getenv(kTangoLogPathVar) (with kTangoLogPathVar = "TANGO_LOG_PATH" )
There is nothing in this part of the code which will look for this environment variable into the tangorc files as it is done in some other parts of the code where some dedicated methods are called, like Connection::get_env_var() method, which can look for the env variable inside the tangorc files too.

If you want, you can create an issue (or PR! smile) about that.
Setting the TANGO_LOG_PATH environment variable via another way is a simple work-around.

Cheers,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Thanks for investigating this. For the moment I won't have time to work on a PR. However I submitted an issue so we don't forget about it: https://github.com/tango-controls/cppTango/issues/500.
 
Register or login to create to post a reply.