Specifying different log levels per target/appender

Dear all,

I would like to ask a question/clarification on logging. From what I've understood it is not possible to set different log levels per log target in a Tango device (for example an INFO level for console and WARN level for device target).
It seems (by looking at the code and from some prototyping I made) that this feature can be enabled by activating the flag APPENDERS_HAVE_LEVEL_THRESHOLD while building TANGO. This flag is not enabled by default in log4tango.
Am I correct? Is there any particular reason why this flag is not set up by default (e.g. feature not fully implemented)? For SKA needs it would be very useful to log at different levels per targets, so it's nice to see that this seems already supported (although not on a default basis). Could you in case confirm if I can safely make these assumptions or if I rather assume this feature as prototypal?

Many thanks for support,

Simone

****************************************************************
Simone Riggi
INAF, Osservatorio Astrofisico di Catania
Via S. Sofia 78
95123, Catania - Italy
phone: +39 095 7332 extension 282
e-mail: simone.riggi@gmail.com,
sriggi@oact.inaf.it
skype: simone.riggi
****************************************************************
You're right Simone, this feature exists but is currently disabled. It's also true that you could hack the logging service in your code to obtain what you want but, as far as the clients do not support the trick, I don't see what kind of added value you could obtain (i.e. changing the logging level from a client would certainly ruin your work).

This logging feature requires a server API extension (e.g. target/log.level list request, per target logging level setter and getter, …) and some work on client side (APIs and GUIs). Might be a good idea for V10.

Edited 7 years ago
Dear Nicolas,

thanks for the feedback.
I try to explain a sample use case for this feature. Assume we have a "local" Tango facility (for example the control system of an antenna deployed in the field) and a "remote" Tango facility (a high level system orchestrating several local facilities).
We were thinking to have (per each device in the "local" facility) two different LogConsumer targets, one local device at INFO level to support local logviewer instances and the other in the remote facility at WARN/ERROR level to support remote logviewer instances that allow viewing only high-priority logs coming from different local facilities.

To support that basically I activated the flag in Tango and added commands to the device server that go through the available appenders and explicitly set the log level per appender or per category of appenders (e.g. SetFileLogLevel, SetConsoleLogLevel, SetDeviceLogLevel). Of course you are right, if a client invokes the builtin dserver commands to set the log level, it will equalize the log levels of all appenders (previously set). So clients would be aware of that, I agree.
Would you think this is an easy-to-add feature for Tango 10?

Hope I clarified a bit my aims,

Thanks again,

Simone
****************************************************************
Simone Riggi
INAF, Osservatorio Astrofisico di Catania
Via S. Sofia 78
95123, Catania - Italy
phone: +39 095 7332 extension 282
e-mail: simone.riggi@gmail.com,
sriggi@oact.inaf.it
skype: simone.riggi
****************************************************************
Would you think this is an easy-to-add feature for Tango 10?
It's just a question of resources to propagate the feature in each API and GUIs. There's no technical problem that could prevent us from implementing it. I invite you to submit your request to Andy (Andy maintains the V10 wishes list). You can also post it in the dedicated topic.
Edited 7 years ago
Hi Nicolas,

Is this feature planned to be there in Tango V10?

-Lochan
 
Register or login to create to post a reply.