blob: 7a595112d6ed5798e14ca84212223a4f91887daa [file] [log] [blame]
Harald Welte3fb0b6f2010-05-19 19:02:52 +02001/* OpenBSC logging helper for the VTY */
2/* (C) 2009-2010 by Harald Welte <laforge@gnumonks.org>
3 * (C) 2009-2010 by Holger Hans Peter Freyther
4 * All Rights Reserved
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 */
21
22#include <stdlib.h>
23#include <string.h>
24
Harald Welte28222962011-02-18 20:37:04 +010025#include "../../config.h"
26
Pablo Neira Ayuso83419342011-03-22 16:36:13 +010027#include <osmocom/core/talloc.h>
28#include <osmocom/core/logging.h>
29#include <osmocom/core/utils.h>
Harald Welte3fb0b6f2010-05-19 19:02:52 +020030
31//#include <openbsc/vty.h>
32
33#include <osmocom/vty/command.h>
34#include <osmocom/vty/buffer.h>
35#include <osmocom/vty/vty.h>
36#include <osmocom/vty/telnet_interface.h>
37#include <osmocom/vty/logging.h>
38
Harald Welte28222962011-02-18 20:37:04 +010039#define LOG_STR "Configure logging sub-system\n"
40
Harald Welte4ebdf742010-05-19 19:54:00 +020041extern const struct log_info *osmo_log_info;
Harald Welte3fb0b6f2010-05-19 19:02:52 +020042
Harald Welte76e72ab2011-02-17 15:52:39 +010043static void _vty_output(struct log_target *tgt,
44 unsigned int level, const char *line)
Harald Welte3fb0b6f2010-05-19 19:02:52 +020045{
46 struct vty *vty = tgt->tgt_vty.vty;
47 vty_out(vty, "%s", line);
48 /* This is an ugly hack, but there is no easy way... */
49 if (strchr(line, '\n'))
50 vty_out(vty, "\r");
51}
52
53struct log_target *log_target_create_vty(struct vty *vty)
54{
55 struct log_target *target;
56
57 target = log_target_create();
58 if (!target)
59 return NULL;
60
61 target->tgt_vty.vty = vty;
62 target->output = _vty_output;
63 return target;
64}
65
66DEFUN(enable_logging,
67 enable_logging_cmd,
68 "logging enable",
69 LOGGING_STR
70 "Enables logging to this vty\n")
71{
72 struct telnet_connection *conn;
73
74 conn = (struct telnet_connection *) vty->priv;
75 if (conn->dbg) {
76 vty_out(vty, "Logging already enabled.%s", VTY_NEWLINE);
77 return CMD_WARNING;
78 }
79
80 conn->dbg = log_target_create_vty(vty);
81 if (!conn->dbg)
82 return CMD_WARNING;
83
84 log_add_target(conn->dbg);
85 return CMD_SUCCESS;
86}
87
Harald Weltea62648b2011-02-18 21:03:27 +010088struct log_target *osmo_log_vty2tgt(struct vty *vty)
89{
90 struct telnet_connection *conn;
91
92 if (vty->node == CFG_LOG_NODE)
93 return vty->index;
94
95
96 conn = (struct telnet_connection *) vty->priv;
97 if (!conn->dbg)
98 vty_out(vty, "Logging was not enabled.%s", VTY_NEWLINE);
99
100 return conn->dbg;
101}
102
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200103DEFUN(logging_fltr_all,
104 logging_fltr_all_cmd,
105 "logging filter all (0|1)",
106 LOGGING_STR FILTER_STR
107 "Do you want to log all messages?\n"
108 "Only print messages matched by other filters\n"
109 "Bypass filter and print all messages\n")
110{
Harald Weltea62648b2011-02-18 21:03:27 +0100111 struct log_target *tgt = osmo_log_vty2tgt(vty);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200112
Harald Weltea62648b2011-02-18 21:03:27 +0100113 if (!tgt)
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200114 return CMD_WARNING;
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200115
Harald Weltea62648b2011-02-18 21:03:27 +0100116 log_set_all_filter(tgt, atoi(argv[0]));
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200117 return CMD_SUCCESS;
118}
119
120DEFUN(logging_use_clr,
121 logging_use_clr_cmd,
122 "logging color (0|1)",
123 LOGGING_STR "Configure color-printing for log messages\n"
124 "Don't use color for printing messages\n"
125 "Use color for printing messages\n")
126{
Harald Weltea62648b2011-02-18 21:03:27 +0100127 struct log_target *tgt = osmo_log_vty2tgt(vty);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200128
Harald Weltea62648b2011-02-18 21:03:27 +0100129 if (!tgt)
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200130 return CMD_WARNING;
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200131
Harald Weltea62648b2011-02-18 21:03:27 +0100132 log_set_use_color(tgt, atoi(argv[0]));
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200133 return CMD_SUCCESS;
134}
135
136DEFUN(logging_prnt_timestamp,
137 logging_prnt_timestamp_cmd,
138 "logging timestamp (0|1)",
139 LOGGING_STR "Configure log message timestamping\n"
140 "Don't prefix each log message\n"
141 "Prefix each log message with current timestamp\n")
142{
Harald Weltea62648b2011-02-18 21:03:27 +0100143 struct log_target *tgt = osmo_log_vty2tgt(vty);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200144
Harald Weltea62648b2011-02-18 21:03:27 +0100145 if (!tgt)
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200146 return CMD_WARNING;
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200147
Harald Weltea62648b2011-02-18 21:03:27 +0100148 log_set_print_timestamp(tgt, atoi(argv[0]));
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200149 return CMD_SUCCESS;
150}
151
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200152DEFUN(logging_level,
153 logging_level_cmd,
Pablo Neira Ayuso04139f12011-03-09 13:05:08 +0100154 NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */
155 NULL) /* same thing for helpstr. */
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200156{
Harald Weltea62648b2011-02-18 21:03:27 +0100157 int category = log_parse_category(argv[0]);
158 int level = log_parse_level(argv[1]);
159 struct log_target *tgt = osmo_log_vty2tgt(vty);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200160
Harald Weltea62648b2011-02-18 21:03:27 +0100161 if (!tgt)
162 return CMD_WARNING;
163
164 if (level < 0) {
165 vty_out(vty, "Invalid level `%s'%s", argv[1], VTY_NEWLINE);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200166 return CMD_WARNING;
167 }
168
Harald Weltea62648b2011-02-18 21:03:27 +0100169 /* Check for special case where we want to set global log level */
170 if (!strcmp(argv[0], "all")) {
171 log_set_log_level(tgt, level);
172 return CMD_SUCCESS;
173 }
174
175 if (category < 0) {
176 vty_out(vty, "Invalid category `%s'%s", argv[0], VTY_NEWLINE);
177 return CMD_WARNING;
178 }
179
180 tgt->categories[category].enabled = 1;
181 tgt->categories[category].loglevel = level;
182
183 return CMD_SUCCESS;
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200184}
185
186DEFUN(logging_set_category_mask,
187 logging_set_category_mask_cmd,
Holger Hans Peter Freyther146d1d32011-10-03 23:15:41 +0200188 "logging set-log-mask MASK",
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200189 LOGGING_STR
Holger Hans Peter Freyther146d1d32011-10-03 23:15:41 +0200190 "Set the logmask of this logging target\n"
191 "The logmask to use\n")
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200192{
Harald Weltea62648b2011-02-18 21:03:27 +0100193 struct log_target *tgt = osmo_log_vty2tgt(vty);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200194
Harald Weltea62648b2011-02-18 21:03:27 +0100195 if (!tgt)
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200196 return CMD_WARNING;
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200197
Harald Weltea62648b2011-02-18 21:03:27 +0100198 log_parse_category_mask(tgt, argv[0]);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200199 return CMD_SUCCESS;
200}
201
Holger Hans Peter Freyther146d1d32011-10-03 23:15:41 +0200202ALIAS_DEPRECATED(logging_set_category_mask,
203 logging_set_category_mask_old_cmd,
204 "logging set log mask MASK",
205 LOGGING_STR
206 "Decide which categories to output.\n"
207 "Log commands\n" "Mask commands\n" "The logmask to use\n");
208
209
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200210DEFUN(diable_logging,
211 disable_logging_cmd,
212 "logging disable",
213 LOGGING_STR
214 "Disables logging to this vty\n")
215{
Harald Weltea62648b2011-02-18 21:03:27 +0100216 struct log_target *tgt = osmo_log_vty2tgt(vty);
217 struct telnet_connection *conn = (struct telnet_connection *) vty->priv;
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200218
Harald Weltea62648b2011-02-18 21:03:27 +0100219 if (!tgt)
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200220 return CMD_WARNING;
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200221
Harald Weltea62648b2011-02-18 21:03:27 +0100222 log_del_target(tgt);
223 talloc_free(tgt);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200224 conn->dbg = NULL;
Harald Weltea62648b2011-02-18 21:03:27 +0100225
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200226 return CMD_SUCCESS;
227}
228
229static void vty_print_logtarget(struct vty *vty, const struct log_info *info,
230 const struct log_target *tgt)
231{
232 unsigned int i;
233
234 vty_out(vty, " Global Loglevel: %s%s",
235 log_level_str(tgt->loglevel), VTY_NEWLINE);
236 vty_out(vty, " Use color: %s, Print Timestamp: %s%s",
237 tgt->use_color ? "On" : "Off",
238 tgt->print_timestamp ? "On" : "Off", VTY_NEWLINE);
239
240 vty_out(vty, " Log Level specific information:%s", VTY_NEWLINE);
241
242 for (i = 0; i < info->num_cat; i++) {
243 const struct log_category *cat = &tgt->categories[i];
244 vty_out(vty, " %-10s %-10s %-8s %s%s",
245 info->cat[i].name+1, log_level_str(cat->loglevel),
246 cat->enabled ? "Enabled" : "Disabled",
247 info->cat[i].description,
248 VTY_NEWLINE);
249 }
250}
251
252#define SHOW_LOG_STR "Show current logging configuration\n"
253
254DEFUN(show_logging_vty,
255 show_logging_vty_cmd,
256 "show logging vty",
257 SHOW_STR SHOW_LOG_STR
258 "Show current logging configuration for this vty\n")
259{
Harald Weltea62648b2011-02-18 21:03:27 +0100260 struct log_target *tgt = osmo_log_vty2tgt(vty);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200261
Harald Weltea62648b2011-02-18 21:03:27 +0100262 if (!tgt)
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200263 return CMD_WARNING;
Harald Weltea62648b2011-02-18 21:03:27 +0100264
265 vty_print_logtarget(vty, osmo_log_info, tgt);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200266
267 return CMD_SUCCESS;
268}
269
270gDEFUN(cfg_description, cfg_description_cmd,
271 "description .TEXT",
272 "Save human-readable decription of the object\n")
273{
274 char **dptr = vty->index_sub;
275
276 if (!dptr) {
277 vty_out(vty, "vty->index_sub == NULL%s", VTY_NEWLINE);
278 return CMD_WARNING;
279 }
280
Holger Hans Peter Freytherff0670e2011-02-24 14:20:41 +0100281 if (*dptr)
282 talloc_free(*dptr);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200283 *dptr = argv_concat(argv, argc, 0);
284 if (!dptr)
285 return CMD_WARNING;
286
287 return CMD_SUCCESS;
288}
289
290gDEFUN(cfg_no_description, cfg_no_description_cmd,
291 "no description",
292 NO_STR
293 "Remove description of the object\n")
294{
295 char **dptr = vty->index_sub;
296
297 if (!dptr) {
298 vty_out(vty, "vty->index_sub == NULL%s", VTY_NEWLINE);
299 return CMD_WARNING;
300 }
301
302 if (*dptr) {
303 talloc_free(*dptr);
304 *dptr = NULL;
305 }
306
307 return CMD_SUCCESS;
308}
309
Harald Welte28222962011-02-18 20:37:04 +0100310/* Support for configuration of log targets != the current vty */
311
312struct cmd_node cfg_log_node = {
313 CFG_LOG_NODE,
314 "%s(config-log)# ",
315 1
316};
317
Harald Welte28222962011-02-18 20:37:04 +0100318#ifdef HAVE_SYSLOG_H
319
320#include <syslog.h>
321
322static const int local_sysl_map[] = {
323 [0] = LOG_LOCAL0,
324 [1] = LOG_LOCAL1,
325 [2] = LOG_LOCAL2,
326 [3] = LOG_LOCAL3,
327 [4] = LOG_LOCAL4,
328 [5] = LOG_LOCAL5,
329 [6] = LOG_LOCAL6,
330 [7] = LOG_LOCAL7
331};
332
Harald Weltede79cee2011-02-24 23:47:57 +0100333/* From VTY core code */
334extern struct host host;
335
Harald Welte28222962011-02-18 20:37:04 +0100336static int _cfg_log_syslog(struct vty *vty, int facility)
337{
338 struct log_target *tgt;
339
340 /* First delete the old syslog target, if any */
341 tgt = log_target_find(LOG_TGT_TYPE_SYSLOG, NULL);
342 if (tgt)
343 log_target_destroy(tgt);
344
Harald Weltede79cee2011-02-24 23:47:57 +0100345 tgt = log_target_create_syslog(host.app_info->name, 0, facility);
Harald Welte28222962011-02-18 20:37:04 +0100346 if (!tgt) {
347 vty_out(vty, "%% Unable to open syslog%s", VTY_NEWLINE);
348 return CMD_WARNING;
349 }
350 log_add_target(tgt);
351
352 vty->index = tgt;
353 vty->node = CFG_LOG_NODE;
354
355 return CMD_SUCCESS;
356}
357
358DEFUN(cfg_log_syslog_local, cfg_log_syslog_local_cmd,
359 "log syslog local <0-7>",
360 LOG_STR "Logging via syslog\n" "Syslog LOCAL facility\n"
361 "Local facility number\n")
362{
363 int local = atoi(argv[0]);
364 int facility = local_sysl_map[local];
365
366 return _cfg_log_syslog(vty, facility);
367}
368
369static struct value_string sysl_level_names[] = {
370 { LOG_AUTHPRIV, "authpriv" },
371 { LOG_CRON, "cron" },
372 { LOG_DAEMON, "daemon" },
373 { LOG_FTP, "ftp" },
374 { LOG_LPR, "lpr" },
375 { LOG_MAIL, "mail" },
376 { LOG_NEWS, "news" },
377 { LOG_USER, "user" },
378 { LOG_UUCP, "uucp" },
379 /* only for value -> string conversion */
380 { LOG_LOCAL0, "local 0" },
381 { LOG_LOCAL1, "local 1" },
382 { LOG_LOCAL2, "local 2" },
383 { LOG_LOCAL3, "local 3" },
384 { LOG_LOCAL4, "local 4" },
385 { LOG_LOCAL5, "local 5" },
386 { LOG_LOCAL6, "local 6" },
387 { LOG_LOCAL7, "local 7" },
388 { 0, NULL }
389};
390
391DEFUN(cfg_log_syslog, cfg_log_syslog_cmd,
392 "log syslog (authpriv|cron|daemon|ftp|lpr|mail|news|user|uucp)",
393 LOG_STR "Logging via syslog\n")
394{
395 int facility = get_string_value(sysl_level_names, argv[0]);
396
397 return _cfg_log_syslog(vty, facility);
398}
399
400DEFUN(cfg_no_log_syslog, cfg_no_log_syslog_cmd,
401 "no log syslog",
402 NO_STR LOG_STR "Logging via syslog\n")
403{
404 struct log_target *tgt;
405
406 tgt = log_target_find(LOG_TGT_TYPE_SYSLOG, NULL);
407 if (!tgt) {
408 vty_out(vty, "%% No syslog target found%s",
409 VTY_NEWLINE);
410 return CMD_WARNING;
411 }
412
413 log_target_destroy(tgt);
414
415 return CMD_SUCCESS;
416}
417#endif /* HAVE_SYSLOG_H */
418
419DEFUN(cfg_log_stderr, cfg_log_stderr_cmd,
420 "log stderr",
421 LOG_STR "Logging via STDERR of the process\n")
422{
423 struct log_target *tgt;
424
425 tgt = log_target_find(LOG_TGT_TYPE_STDERR, NULL);
426 if (!tgt) {
427 tgt = log_target_create_stderr();
428 if (!tgt) {
429 vty_out(vty, "%% Unable to create stderr log%s",
430 VTY_NEWLINE);
431 return CMD_WARNING;
432 }
433 log_add_target(tgt);
434 }
435
436 vty->index = tgt;
437 vty->node = CFG_LOG_NODE;
438
439 return CMD_SUCCESS;
440}
441
442DEFUN(cfg_no_log_stderr, cfg_no_log_stderr_cmd,
443 "no log stderr",
444 NO_STR LOG_STR "Logging via STDERR of the process\n")
445{
446 struct log_target *tgt;
447
448 tgt = log_target_find(LOG_TGT_TYPE_STDERR, NULL);
449 if (!tgt) {
450 vty_out(vty, "%% No stderr logging active%s", VTY_NEWLINE);
451 return CMD_WARNING;
452 }
453
454 log_target_destroy(tgt);
455
456 return CMD_SUCCESS;
457}
458
459DEFUN(cfg_log_file, cfg_log_file_cmd,
460 "log file .FILENAME",
461 LOG_STR "Logging to text file\n" "Filename\n")
462{
463 const char *fname = argv[0];
464 struct log_target *tgt;
465
466 tgt = log_target_find(LOG_TGT_TYPE_FILE, fname);
467 if (!tgt) {
468 tgt = log_target_create_file(fname);
469 if (!tgt) {
470 vty_out(vty, "%% Unable to create file `%s'%s",
471 fname, VTY_NEWLINE);
472 return CMD_WARNING;
473 }
474 log_add_target(tgt);
475 }
476
477 vty->index = tgt;
478 vty->node = CFG_LOG_NODE;
479
480 return CMD_SUCCESS;
481}
482
483
484DEFUN(cfg_no_log_file, cfg_no_log_file_cmd,
485 "no log file .FILENAME",
486 NO_STR LOG_STR "Logging to text file\n" "Filename\n")
487{
488 const char *fname = argv[0];
489 struct log_target *tgt;
490
491 tgt = log_target_find(LOG_TGT_TYPE_FILE, fname);
492 if (!tgt) {
493 vty_out(vty, "%% No such log file `%s'%s",
494 fname, VTY_NEWLINE);
495 return CMD_WARNING;
496 }
497
498 log_target_destroy(tgt);
499
500 return CMD_SUCCESS;
501}
502
503static int config_write_log_single(struct vty *vty, struct log_target *tgt)
504{
505 int i;
506 char level_lower[32];
507
508 switch (tgt->type) {
509 case LOG_TGT_TYPE_VTY:
510 return 1;
511 break;
512 case LOG_TGT_TYPE_STDERR:
513 vty_out(vty, "log stderr%s", VTY_NEWLINE);
514 break;
515 case LOG_TGT_TYPE_SYSLOG:
516#ifdef HAVE_SYSLOG_H
517 vty_out(vty, "log syslog %s%s",
518 get_value_string(sysl_level_names,
519 tgt->tgt_syslog.facility),
520 VTY_NEWLINE);
521#endif
522 break;
523 case LOG_TGT_TYPE_FILE:
524 vty_out(vty, "log file %s%s", tgt->tgt_file.fname, VTY_NEWLINE);
525 break;
526 }
527
528 vty_out(vty, " logging color %u%s", tgt->use_color ? 1 : 0,
529 VTY_NEWLINE);
530 vty_out(vty, " logging timestamp %u%s", tgt->print_timestamp ? 1 : 0,
531 VTY_NEWLINE);
532
533 /* stupid old osmo logging API uses uppercase strings... */
534 osmo_str2lower(level_lower, log_level_str(tgt->loglevel));
535 vty_out(vty, " logging level all %s%s", level_lower, VTY_NEWLINE);
536
537 for (i = 0; i < osmo_log_info->num_cat; i++) {
538 const struct log_category *cat = &tgt->categories[i];
539 char cat_lower[32];
540
541 /* stupid old osmo logging API uses uppercase strings... */
542 osmo_str2lower(cat_lower, osmo_log_info->cat[i].name+1);
543 osmo_str2lower(level_lower, log_level_str(cat->loglevel));
544
545 vty_out(vty, " logging level %s %s%s", cat_lower, level_lower,
546 VTY_NEWLINE);
547 }
548
549 /* FIXME: levels */
550
551 return 1;
552}
553
554static int config_write_log(struct vty *vty)
555{
556 struct log_target *dbg = vty->index;
557
558 llist_for_each_entry(dbg, &osmo_log_target_list, entry)
559 config_write_log_single(vty, dbg);
560
561 return 1;
562}
563
Pablo Neira Ayuso04139f12011-03-09 13:05:08 +0100564void logging_vty_add_cmds(const struct log_info *cat)
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200565{
566 install_element_ve(&enable_logging_cmd);
567 install_element_ve(&disable_logging_cmd);
568 install_element_ve(&logging_fltr_all_cmd);
569 install_element_ve(&logging_use_clr_cmd);
570 install_element_ve(&logging_prnt_timestamp_cmd);
571 install_element_ve(&logging_set_category_mask_cmd);
Holger Hans Peter Freyther146d1d32011-10-03 23:15:41 +0200572 install_element_ve(&logging_set_category_mask_old_cmd);
Pablo Neira Ayuso04139f12011-03-09 13:05:08 +0100573
574 /* Logging level strings are generated dynamically. */
575 logging_level_cmd.string = log_vty_command_string(cat);
576 logging_level_cmd.doc = log_vty_command_description(cat);
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200577 install_element_ve(&logging_level_cmd);
578 install_element_ve(&show_logging_vty_cmd);
Harald Welte28222962011-02-18 20:37:04 +0100579
580 install_node(&cfg_log_node, config_write_log);
Harald Weltea62648b2011-02-18 21:03:27 +0100581 install_element(CFG_LOG_NODE, &logging_fltr_all_cmd);
582 install_element(CFG_LOG_NODE, &logging_use_clr_cmd);
583 install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd);
584 install_element(CFG_LOG_NODE, &logging_level_cmd);
Harald Welte28222962011-02-18 20:37:04 +0100585
586 install_element(CONFIG_NODE, &cfg_log_stderr_cmd);
587 install_element(CONFIG_NODE, &cfg_no_log_stderr_cmd);
588 install_element(CONFIG_NODE, &cfg_log_file_cmd);
589 install_element(CONFIG_NODE, &cfg_no_log_file_cmd);
590#ifdef HAVE_SYSLOG_H
591 install_element(CONFIG_NODE, &cfg_log_syslog_cmd);
592 install_element(CONFIG_NODE, &cfg_log_syslog_local_cmd);
593 install_element(CONFIG_NODE, &cfg_no_log_syslog_cmd);
594#endif
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200595}