+static clib_error_t *
+show_log_config (vlib_main_t * vm,
+ unformat_input_t * input, vlib_cli_command_t * cmd)
+{
+ clib_error_t *error = 0;
+ vlib_log_main_t *lm = &log_main;
+ vlib_log_class_data_t *c;
+ vlib_log_subclass_data_t *sc;
+
+ vlib_cli_output (vm, "%-20s %u entries", "Buffer Size:", lm->size);
+ vlib_cli_output (vm, "Defaults:\n");
+ vlib_cli_output (vm, "%-20s %U", " Log Level:",
+ format_vlib_log_level, lm->default_log_level);
+ vlib_cli_output (vm, "%-20s %U", " Syslog Log Level:",
+ format_vlib_log_level, lm->default_syslog_log_level);
+ vlib_cli_output (vm, "%-20s %u msgs/sec", " Rate Limit:",
+ lm->default_rate_limit);
+ vlib_cli_output (vm, "\n");
+ vlib_cli_output (vm, "%-22s %-14s %-14s %s",
+ "Class/Subclass", "Level", "Syslog Level", "Rate Limit");
+
+
+ u8 *defstr = format (0, "default");
+ vec_foreach (c, lm->classes)
+ {
+ vlib_cli_output (vm, "%v", c->name);
+ vec_foreach (sc, c->subclasses)
+ {
+ vlib_cli_output (vm, " %-20v %-14U %-14U %d",
+ sc->name ? sc->name : defstr,
+ format_vlib_log_level, sc->level,
+ format_vlib_log_level, sc->syslog_level,
+ sc->rate_limit);
+ }
+ }
+ vec_free (defstr);
+
+ return error;
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (cli_show_log_config, static) = {
+ .path = "show logging configuration",
+ .short_help = "show logging configuration",
+ .function = show_log_config,
+};
+/* *INDENT-ON* */
+