Allow yaz_log time-stamp format to be set MP-430
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 12 Mar 2013 18:04:30 +0000 (19:04 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 12 Mar 2013 18:05:26 +0000 (19:05 +0100)
This done at a global level via option -m for megaproxy server.

doc/log.xml
doc/metaproxy.xml
src/metaproxy_prog.cpp

index ca8bd30..9d18763 100644 (file)
       </para>
      </listitem>
     </varlistentry>
+    <varlistentry><term>time-format</term>
+     <listitem>
+      <para>
+       Date+time format if log is written to a custom file (see filename configuration, below), using the format of
+       <ulink
+          url="http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html">
+       strftime(3)</ulink>.
+      </para>
+      <para>
+       Use option -m in invocation of Metaproxy command to set format if yaz_log is used (no filename given).
+      </para>
+     </listitem>
+    </varlistentry>
     <varlistentry><term>filename</term>
      <listitem>
       <para>
-       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).
       </para>
      </listitem>
     </varlistentry>
index 622f215..a41b625 100644 (file)
@@ -32,6 +32,7 @@
    <arg choice="opt"><option>--config <replaceable>config</replaceable></option></arg>
    <arg choice="opt"><option>-D</option></arg>
    <arg choice="opt"><option>-l <replaceable>logfile</replaceable></option></arg>
+   <arg choice="opt"><option>-m <replaceable>timeformat</replaceable></option></arg>
    <arg choice="opt"><option>-p <replaceable>pidfile</replaceable></option></arg>
    <arg choice="opt"><option>-t</option></arg>
    <arg choice="opt"><option>-u <replaceable>ID</replaceable></option></arg>
    </varlistentry>
 
    <varlistentry>
+    <term>-m <replaceable>timeformat</replaceable></term>
+    <listitem><para>
+     Sets the format of time-stamps for all logging performed via yaz_log.
+     Refer to
+       <ulink
+          url="http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html">
+       strftime(3)</ulink>
+       man page for the format.
+    </para></listitem>
+   </varlistentry>
+
+   <varlistentry>
     <term>-p <replaceable>pidfile</replaceable></term>
     <listitem><para>
       Specifies file which holds PID after startup.
index c6d582f..6f48973 100644 (file)
@@ -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;