From cad85a512ba53d408d7bede0a752474d8d648dc8 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 12 Mar 2013 19:04:30 +0100 Subject: [PATCH] Allow yaz_log time-stamp format to be set MP-430 This done at a global level via option -m for megaproxy server. --- doc/log.xml | 16 +++++++++++++++- doc/metaproxy.xml | 13 +++++++++++++ src/metaproxy_prog.cpp | 6 +++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/doc/log.xml b/doc/log.xml index ca8bd30..9d18763 100644 --- a/doc/log.xml +++ b/doc/log.xml @@ -36,10 +36,24 @@ + time-format + + + Date+time format if log is written to a custom file (see filename configuration, below), using the format of + + strftime(3). + + + Use option -m in invocation of Metaproxy command to set format if yaz_log is used (no filename given). + + + filename - Specifies a name of log file. + Specifies a name of log file. If this is omitted, logging is performed + using the log system of YAZ (yaz_log). diff --git a/doc/metaproxy.xml b/doc/metaproxy.xml index 622f215..a41b625 100644 --- a/doc/metaproxy.xml +++ b/doc/metaproxy.xml @@ -32,6 +32,7 @@ + @@ -87,6 +88,18 @@ + -m timeformat + + Sets the format of time-stamps for all logging performed via yaz_log. + Refer to + + strftime(3) + man page for the format. + + + + -p pidfile Specifies file which holds PID after startup. diff --git a/src/metaproxy_prog.cpp b/src/metaproxy_prog.cpp index c6d582f..6f48973 100644 --- a/src/metaproxy_prog.cpp +++ b/src/metaproxy_prog.cpp @@ -124,7 +124,7 @@ static int sc_main( set_log_prefix(); - while ((ret = options("c{config}:Dh{help}l:p:tu:V{version}w:X", + while ((ret = options("c{config}:Dh{help}l:m:p:tu:V{version}w:X", argv, argc, &arg)) != -2) { switch (ret) @@ -142,6 +142,7 @@ static int sc_main( " -c|--config f config filename\n" " -D daemon and keepalive operation\n" " -l f log file f\n" + " -m logformat log time format (strftime)\n" " -p f pid file f\n" " -t test configuration\n" " -u id change uid to id\n" @@ -157,6 +158,9 @@ static int sc_main( case 'l': yaz_log_init_file(arg); break; + case 'm': + yaz_log_time_format(arg); + break; case 'p': pidfile = arg; break; -- 1.7.10.4