summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2023-05-06 06:47:05 -0400
committerGitHub <noreply@github.com>2023-05-06 06:47:05 -0400
commit69b7c34e8856ed8537441220beca4bed323798c0 (patch)
tree1c72de220c7145b5512e75a3b3ae88b04d7201a7 /lib/command.c
parent4ead6555c9ed47d6e512512b4a1989830be90d94 (diff)
parent3701780a15f90e9e64a32fd24bb8d2887b3a4ef9 (diff)
Merge pull request #13424 from LabNConsulting/chopps/log-config-file-cmds
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c
index 27cd3a04bd..7a7ce3f5dc 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