![]() |
![]()
| ![]() |
![]()
NAMEyaz-log - Log handling in all yaz-based programs SYNOPSISyaz-XXXX [-v loglevel,...] [-l logfile] DESCRIPTIONAll YAZ-based programs use a common log subsystem, and should support common command line options for controlling it. This man page documents those. OPTIONS-l logfile Specify the file where the log is to be written. If none
is specified, stderr is used. The log is appended to this file. If the file
grows overly large, it is silently rotated: It is renamed to logfile.1,
logfile.2, .., 9 (old such file is deleted), and a new file is opened.
The limit defaults to 1GB, but can be set by the program. The rotating limit
can be specified with option -r for the YAZ frontend server (yaz-ztest).
Rotation can also be implicitly enabled by using a filename which gets changed for a given date, due to substitutions as given by the strftime(3) function. -v loglevel Specify the logging level. The argument is a set of log
level names, separated by commas (no whitespace!), optionally preceded by a
'-' to negate that level. Most programs have their own default, often
containing fatal,warn,log, and some application-specific values. The default
list can be cleared with the word none, or individual bits can be removed by
prefixing them with a dash '-'.
LOG LEVELS TO CONTROL LOGGINGSome of the log levels control the way the log is written. flush causes the log to be flushed after every write. This can have serious implications to performance, and should not be used in production. On the other hand, when debugging a program crash, this can be extremely useful. The option debug implies flush as well. notime prevents the writing of time stamps. This is intended for automatic test scripts, which should produce predictable log files that are easy to compare. GENERAL LOG LEVELS IN YAZ ITSELFYAZ itself uses the following log levels: fatal for fatal errors, that prevent further execution of the program. warn for warnings about things that should be corrected. debug for debugging. This flag may be used temporarily when developing or debugging yaz, or a program that uses yaz. It is practically deprecated, you should be defining and using your own log levels (see below). all turns on almost all hard-coded log levels. loglevel logs information about the log levels used by the program. Every time the log level is changed, lists all bits that are on. Every time a module asks for its log bits, this is logged. This can be used for getting an idea of what log levels are available in any program that uses yaz-log. Start the program with -v none,loglevel, and do some common operations with it. Another way is to grep for yaz_log_module_level in the source code, as in
eventl, malloc, nmem, odr are used internally for debugging yaz. LOG LEVELS FOR CLIENTSzoom logs the calls to the zoom API, which may be useful in debugging client applications. LOG LEVELS FOR SERVERSserver logs the server functions on a high level, starting up, listening on a port, etc. session logs individual sessions (connections). request logs a one-liner for each request (init, search, etc.). requestdetail logs the details of every request, before it is passed to the back-end, and the results received from it. Each server program (zebra, etc.) is supposed to define its own log levels in addition to these. As they depend on the server in question, they can not be described here. See above how to find out about them. LOGGING EXAMPLESSee what log levels yaz-ztest is using:
See the details of the requests for yaz-ztest
LOG FILENAME EXAMPLESA file with format my_YYYYMMDD.log (where Y, M, D is year, month, and day digits) is given as follows: -l my_%Y%m%d.log . And since the filename is depending on day, rotation will occur on midnight. A weekly log could be specified as -l my_%Y%U.log. FILESprefix/include/yaz/log.h prefix/src/log.c SEE ALSOyaz(7) yaz-ztest(8) yaz-client(1) strftime(3) AUTHORSIndex Data
|