diff options
author | Christian Hopps <chopps@labn.net> | 2023-05-03 06:41:19 +0200 |
---|---|---|
committer | Christian Hopps <chopps@labn.net> | 2023-05-04 20:48:59 +0200 |
commit | 3701780a15f90e9e64a32fd24bb8d2887b3a4ef9 (patch) | |
tree | 090451bdba5cca05e6cde063425a2933b24106af /lib/command.c | |
parent | Merge pull request #13357 from Jafaral/fix_ospf_prop (diff) | |
download | frr-3701780a15f90e9e64a32fd24bb8d2887b3a4ef9.tar.xz frr-3701780a15f90e9e64a32fd24bb8d2887b3a4ef9.zip |
lib: log commands read from config file
When the user specifies `--command-log-always` in CLI arguments then also log
commands executed from loading the config file.
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/command.c')
-rw-r--r-- | lib/command.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c index 27cd3a04b..7a7ce3f5d 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1303,6 +1303,14 @@ int config_from_file(struct vty *vty, FILE *fp, unsigned int *line_num) while (fgets(vty->buf, VTY_BUFSIZ, fp)) { ++(*line_num); + if (vty_log_commands) { + int len = strlen(vty->buf); + + /* now log the command */ + zlog_notice("config-from-file# %.*s", len ? len - 1 : 0, + vty->buf); + } + ret = command_config_read_one_line(vty, NULL, *line_num, 0); if (ret != CMD_SUCCESS && ret != CMD_WARNING |