quattor / configuration-modules-core

Node Configuration Manager Components for Everyone
www.quattor.org
Other
7 stars 56 forks source link

ncm-metaconfig 23.6: log execution of actions in main log file #1664

Open jouvin opened 9 months ago

jouvin commented 9 months ago

I started to use the powerful actions in ncm-metaconfig. But currently there is nothing in the main log (ncm-cdispd.log) related to the execution of these actions: only daemon restarts are logged. This may be a source of confusion. I'd suggest to have one line per action type (pre, test, changed , post) listing the commands executed (the key value in /software/components/metaconfig/commands) in much the same way we list the daemons restarted.

ned21 commented 8 months ago

Aren't these executed via a standard CAF function, which ought to already log everything it does? Or are you saying that you see the command being executed but want to log the reason for the execution?

stdweird commented 8 months ago

this is indeed odd. all execution should be logged in the component logfile with verbose level. if these commands are not in there, then we have a serious problem. @jouvin can you give some example what you expect to see.

jouvin commented 8 months ago

@stdweird I apologize for not being clear enough... Every action is perfectly logged in the component log file. My point is that our (my) way of checking Quattor deployment is to check ncm-cdispd.log and only if something requires more information to look at the component file. And in this file, there is nothing about executed metaconfig actions other than those on daemons.

To be a bit more concrete, with a config like:

prefix '/software/components/metaconfig';
'commands/mycmd' = '/bin/echo test';
'services/{/x/yz/z}/actions/post' = 'mycmd';

I'd like to see in ncm-cdispd.log a summary line like:

Executing post actions: mycmd

And the same for the other types of actions (pre, test, changed). It is particularly important for post which is executed every time the component is run.

Hopefully it is more clear!

stdweird commented 8 months ago

https://github.com/quattor/configuration-modules-core/blob/master/ncm-metaconfig/src/main/perl/metaconfig.pm#L209 logs the actions with either error or verbose. i think what ends up in the ncm-cdispd.log is info or higher.

@jouvin can you try to patch that line to info instead of verbose, and see if it gives what you want?

jouvin commented 8 months ago

I'll try to have a look...