Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>
---
 config.c | 1 +
 ptp4l.8  | 8 ++++++--
 ptp4l.c  | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/config.c b/config.c
index bbaf36e..119fec2 100644
--- a/config.c
+++ b/config.c
@@ -199,6 +199,7 @@ struct config_item config_tab[] = {
        PORT_ITEM_INT("logMinPdelayReqInterval", 0, INT8_MIN, INT8_MAX),
        PORT_ITEM_INT("logSyncInterval", 0, INT8_MIN, INT8_MAX),
        GLOB_ITEM_INT("logging_level", LOG_INFO, PRINT_LEVEL_MIN, 
PRINT_LEVEL_MAX),
+       GLOB_ITEM_STR("log_file", NULL),
        GLOB_ITEM_STR("message_tag", NULL),
        GLOB_ITEM_STR("manufacturerIdentity", "00:00:00"),
        GLOB_ITEM_INT("max_frequency", 900000000, 0, INT_MAX),
diff --git a/ptp4l.8 b/ptp4l.8
index a724151..ae67c65 100644
--- a/ptp4l.8
+++ b/ptp4l.8
@@ -485,9 +485,13 @@ is 0.
 The maximum logging level of messages which should be printed.
 The default is 6 (LOG_INFO).
 .TP
+.B log_file
+Print messages to the specified file. The default is no file (which cannot be
+specified in the configuration file as the option requires an argument).
+.TP
 .B message_tag
-The tag which is added to all messages printed to the standard output or system
-log.
+The tag which is added to all messages printed to the standard output, log
+file, or system log.
 The default is an empty string (which cannot be set in the configuration file
 as the option requires an argument).
 .TP
diff --git a/ptp4l.c b/ptp4l.c
index f01ff6f..98c5bda 100644
--- a/ptp4l.c
+++ b/ptp4l.c
@@ -187,6 +187,7 @@ int main(int argc, char *argv[])
        print_set_verbose(config_get_int(cfg, NULL, "verbose"));
        print_set_syslog(config_get_int(cfg, NULL, "use_syslog"));
        print_set_level(config_get_int(cfg, NULL, "logging_level"));
+       print_set_logfile(config_get_string(cfg, NULL, "log_file"));
 
        assume_two_step = config_get_int(cfg, NULL, "assume_two_step");
        sk_check_fupsync = config_get_int(cfg, NULL, "check_fup_sync");
-- 
2.9.3


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to