X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Ftools.xml;h=e67661c0523a122d9dadfe976e79bbb056a1b289;hb=86385826e403a1e2e194f41657e7e8470c33d4ed;hp=add24b4c022007ca84152f5f56e640db08d4e365;hpb=08eb8faf0366e6e0814ecd80ddd0ce6392424a52;p=yaz-moved-to-github.git diff --git a/doc/tools.xml b/doc/tools.xml index add24b4..e67661c 100644 --- a/doc/tools.xml +++ b/doc/tools.xml @@ -1,4 +1,4 @@ - + Supporting Tools @@ -1803,12 +1803,12 @@ typedef struct oident production use of those applications. - The log functions are declared in header yaz/ylog.h + The log functions are declared in header yaz/log.h and implemented in src/log.c. Due to name clash with syslog and some math utilities the logging interface has been modified as of YAZ 2.0.29. The obsolete interface - is still available if the application includes - yaz/log.h. The key points of the interface are: + is still available if in header file yaz/log.h. + The key points of the interface are: void yaz_log(int level, const char *fmt, ...) @@ -1835,10 +1835,11 @@ typedef struct oident The log level is a bit mask, that says on which level(s) the log entry should be made, and optionally set some behaviour of the logging. In the most simple cases, it can be one of YLOG_FATAL, - YLOG_DEBUG, YLOG_WARN, YLOG_LOG. Those can be combined with bits - that modify the way the log entry is written:YLOG_ERRNO, - YLOG_NOTIME, YLOG_FLUSH. - Most of the rest of the bits are deprecated, and should not be used. + YLOG_DEBUG, YLOG_WARN, YLOG_LOG. Those can be combined with bits + that modify the way the log entry is written:YLOG_ERRNO, + YLOG_NOTIME, YLOG_FLUSH. + Most of the rest of the bits are deprecated, and should not be used. Use + the dynamic log levels instead. @@ -1874,6 +1875,17 @@ typedef struct oident + Yaz uses the following dynamic log levels: + server, session, request, requestdetail for the server + functionality. + zoom for the zoom client api. + ztest for the simple test server. + malloc, nmem, odr, eventl for internal debugging of yaz itself. + Of course, any program using yaz is welcome to define as many new ones, as + it needs. + + + By default the log is written to stderr, but this can be changed by a call to yaz_log_init_file or yaz_log_init. If the log is directed to a file, the @@ -1884,6 +1896,15 @@ typedef struct oident rotation feature. + + A typical yaz-log looks like this + 13:23:14-23/11 yaz-ztest(1) [session] Starting session from tcp:127.0.0.1 (pid=30968) + 13:23:14-23/11 yaz-ztest(1) [request] Init from 'YAZ' (81) (ver 2.0.28) OK + 13:23:17-23/11 yaz-ztest(1) [request] Search Z: @attrset Bib-1 foo OK:7 hits + 13:23:22-23/11 yaz-ztest(1) [request] Present: [1] 2+2 OK 2 records returned + 13:24:13-23/11 yaz-ztest(1) [request] Close OK + + The log entries start with a time stamp. This can be omitted by setting the YLOG_NOTIME bit in the loglevel. This way automatic tests @@ -1894,10 +1915,11 @@ typedef struct oident - Next in a log line comes the prefix, often the name of the program. Then + Next in a log line comes the prefix, often the name of the program. For + yaz-based servers, it can also contain the session number. Then comes one or more logbits in square brackets, depending on the logging level set by yaz_log_init_level and the loglevel - passed to yaz_log_init_level. Finally comes all format + passed to yaz_log_init_level. Finally comes the format string and additional values passed to yaz_log @@ -1915,7 +1937,10 @@ typedef struct oident - The dynamic log levels and log rotation were introduced in &yaz; 2.0.28. + The dynamic log levels and log rotation were introduced in &yaz; 2.0.28. At + the same time, the log bit names were changed from + LOG_something to YLOG_something, + to avoid collision with syslog.h.