-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CAF::FileWriter does not log file changes #100
Comments
@ned21 i'd prefer not raise the default to |
Logging verbose message to the file by default but not to stdout is fine with me. We always try to be generous with what we log to a file and conservative with what we log to stdout. |
@ned21 @jrha i've changed my mind a bit how to handle this. i still tend to implement the splitted loglevels, but i'm afraid im'm going to reinvent Log4Perl or something like that. |
@ned21 this is now stdout with #117, #98 and quattor/ncm-ncd#51
so no more |
but i'm afraid im'm going to reinvent Log4Perl or something like that.
So, why not replace CAF::Log with Log::Log4perl (or make CAF::Log use
Log::Log4perl instead of LC::Log)?
|
@Piojo instead of |
@ned21 the format is whatever we agree on. i guess there will be more remarks on the PRs, this is just something that could be done. the info is logged in https://github.com/quattor/ncm-ncd/pull/51/files#diff-160e27257dcc0fd21f34efa66afec9bbR344, but nothing should prevent to do something different. "a separate log that can be parsed" sounds like part of actual solution of quattor/ncm-ncd#14. |
I completely missed this discussion... I tend to agree that having this kind of logging done by CAF would be a useful addition but we need to take into account that several/many components already do some logging based on CAF |
@jouvin to be clear, this is about reducing the loglevels in CAF, it should indeed be left to the component or in e.g. the component does not log a single thing, it is |
May be my wording was not clear, I wanted to say that I would not like to see unconditionnally some messages logged by CAF at info level without a way for a component to disable it. I understand that the exact amount of information really displayed is controled by |
the example reports the events after the component finished to run, so it done only by |
I missed that. I agree that if this is a summary added by |
pushing this to 16.6. i'll add some functionality to report certain events when they are called, not at the end |
At workshop we decided to change ncm-ncd so that verbose messages are always logged to the file, regardless of whether --verbose is passed on the command line. This will mean that the current log file will always reflect what files were changed and the diff. This cannot leak information provided the log files have the same permissions as the profile directory. Using CAF::History to generate machine parseable history will be covered by separate issues. |
@ned21 i only now see the "provided the log files have the same permissions as the profile directory" remark. |
Should be fully covered in code, but the defaults are not what agreed upon to allow a migration form legacy behaviour. 2 issues are opened to change the defaults to always log with verbose_logfile quattor/ncm-ncd#94 and to make the logdir not world_readable quattor/ncm-ncd#93 |
Follow up from discussion in #98.
With --verbose we display the diff and log that the file was updated (which also gets echo'd to screen). Without --verbose we display nothing. Do we log anything? It would appear not because stdout is just an out of the logger, and verbose defaults to false. This seems suboptimal to me: whether a file has been changed or not should always be logged, even if not shown on stdout. Making the diff optional seems OK, especially since we don't want to log sensitive information.
A simple fix would be to log the result of the Check::File at info level. Given that until #98 this was being printed to stdout it would not be a net increase in the amount of lines shown on stdout during an interactive run.
The text was updated successfully, but these errors were encountered: