This option specifies a file which should be used for logging instead of syslog
or terminal.
+*-L* _level_::
+This option specifies the minimum severity level of messages to be written to
+the log file, syslog, or terminal. The following levels can be specified:
+0 (informational), 1 (warning), 2 (non-fatal error), and 3 (fatal error). The
+default value is 0.
+
*-q*::
When run in this mode, *chronyd* will set the system clock once and exit. It
will not detach from the terminal.
int opt, debug = 0, nofork = 0, address_family = IPADDR_UNSPEC;
int do_init_rtc = 0, restarted = 0, client_only = 0, timeout = 0;
int scfilter_level = 0, lock_memory = 0, sched_priority = 0;
- int clock_control = 1, system_log = 1;
+ int clock_control = 1, system_log = 1, log_severity = LOGS_INFO;
int config_args = 0;
do_platform_checks();
optind = 1;
/* Parse short command-line options */
- while ((opt = getopt(argc, argv, "46df:F:hl:mnP:qQrRst:u:vx")) != -1) {
+ while ((opt = getopt(argc, argv, "46df:F:hl:L:mnP:qQrRst:u:vx")) != -1) {
switch (opt) {
case '4':
case '6':
case 'l':
log_file = optarg;
break;
+ case 'L':
+ log_severity = parse_int_arg(optarg);
+ break;
case 'm':
lock_memory = 1;
break;
LOG_OpenSystemLog();
}
- LOG_SetMinSeverity(debug >= 2 ? LOGS_DEBUG : LOGS_INFO);
+ LOG_SetMinSeverity(debug >= 2 ? LOGS_DEBUG : log_severity);
LOG(LOGS_INFO, "chronyd version %s starting (%s)", CHRONY_VERSION, CHRONYD_FEATURES);