@DATABASE SysLog.guide
@AUTHOR "Petri Nordlund"
@(C) "Copyright © 1995 Petri Nordlund. All rights reserved."

@NODE Main "Main menu"

@{BG FILL}    @{FG HIGHLIGHT}@{I}S y s L o g@{UI}@{FG TEXT}                                                        @{BG BACK}

@{BG HIGHLIGHT}   @{BG BACK}
@{BG HIGHLIGHT}   @{BG BACK}  @{"           Copyright           " link Copyright}   @{"        Acknowledgments        " link Acknowledgments}
@{BG HIGHLIGHT}   @{BG BACK}

@{BG FILL}   @{BG BACK}
@{BG FILL}   @{BG BACK}  @{"         Introduction          " link Introduction}   @{"          Developers           " link Developers}
@{BG FILL}   @{BG BACK}
@{BG FILL}   @{BG BACK}  @{"            Author             " link Author}   @{"            History            " link History}
@{BG FILL}   @{BG BACK}

@{BG SHADOW}   @{BG BACK}
@{BG SHADOW}   @{BG BACK}  @{"         SysLogDaemon          " link SysLogDaemon}   @{"            logger             " link logger}
@{BG SHADOW}   @{BG BACK}
@{BG SHADOW}   @{BG BACK}  @{"             LOG:              " link LOG}   @{"           newsyslog           " link newsyslog}
@{BG SHADOW}   @{BG BACK}

@{BG FILL}    @{FG HIGHLIGHT}by Petri Nordlund@{FG TEXT}                                                        @{BG BACK}
@ENDNODE

@NODE Copyright "Copyright"

@{FG SHINE}COPYRIGHT@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Copyright © 1995 Petri Nordlund.


  Copyright (c) 1983, 1988 Regents of the University of California.
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:
  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software
     must display the following acknowledgement:
  This product includes software developed by the University of
  California, Berkeley and its contributors.
  4. Neither the name of the University nor the names of its contributors
     may be used to endorse or promote products derived from this software
     without specific prior written permission.
  
  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  SUCH DAMAGE.


  Copyright 1988, 1989 by the Massachusetts Institute of Technology

  Permission to use, copy, modify, and distribute this software
  and its documentation for any purpose and without fee is
  hereby granted, provided that the above copyright notice
  appear in all copies and that both that copyright notice and
  this permission notice appear in supporting documentation,
  and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
  used in advertising or publicity pertaining to distribution
  of the software without specific, written prior permission.
  M.I.T. and the M.I.T. S.I.P.B. make no representations about
  the suitability of this software for any purpose.  It is
  provided "as is" without express or implied warranty.


@{FG SHINE}DISCLAIMER@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  THE POSSIBILITY OF SUCH DAMAGE.


@{FG SHINE}TRADEMARKS@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Amiga and Workbench are trademarks of Amiga Technologies GmbH.

  UNIX is a trademark of X/Open Company Ltd.

@ENDNODE

@NODE Acknowledgments "Acknowledgments"

@{FG SHINE}ACKNOWLEDGMENTS@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SysLog is based on NetBSD syslog software developed by the University of
California, Berkeley and its contributors. Newsyslog was developed by
Theodore Ts'o, of the Massachusetts Institute of Technology.

Code has been modified and improved to make it work on Amiga.

@ENDNODE

@NODE Introduction "Introduction"

@{FG SHINE}INTRODUCTION@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SysLog is a system that let's you log messages from various sources to
various destinations. Here's a small diagram of SysLog:

                          ________________
   logger  ------------> |                |
                         |                | --> SysLogDaemon -> log files
   LOG:    ------------> | syslog.library | 
                         |                | --> (other log daemons)
   other programs -----> |________________|
   that support SysLog

@{"Logger" LINK logger} is a program that let's users to log messages
to the system log. @{"LOG:" LINK LOG} is a device that redirects everything written
to it to the system log.

If the @{"SysLogDaemon" LINK SysLogDaemon} (or another log daemon) isn't running, all log
messages are discarded. SysLogDaemon is usually started when the system is
booted.

The @{"newsyslog" LINK newsyslog} program is used to maintain log files. It can be configured
to automatically archive old log files.

@ENDNODE

@NODE FacLev "Facilities and levels"

@{FG SHINE}FACILITIES AND LEVELS@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Each message has a facility and a level. Facility tells us who
generated the message, and level indicates how important the
message is.

Facility and level always form a pair:

  facility.level

The facility is separated from the level by a period. For example:

  user.notice
  kern.debug
  mail.info
  

@{B}FACILITIES@{UB}

  kern           kernel/system messages
  user           user-level messages
  mail           mail system
  daemon         system daemons/commodities
  auth           security/authorization messages
  syslog         messages generated internally by SysLogDaemon
  news           network news subsystem
  uucp           UUCP sybsystem
  cron           cron utility
  authpriv       security/authorization messages (private)
  ftp            ftp daemon
  mark           internal mark messages generated by SysLogDaemon
  local0         reserved for local use
  local1         reserved for local use
  local2         reserved for local use
  local3         reserved for local use
  local4         reserved for local use
  local5         reserved for local use
  local6         reserved for local use
  local7         reserved for local use


@{B}LEVELS@{UB}

  emerg          indicates emergency situtation, system is unusable
  alert          action must be taken immediately
  crit           critical condition
  err            error condition
  warning        warning condition
  notice         normal but significant condition
  info           informational
  debug          debug-level messages

@ENDNODE

@NODE Developers "Developers"

@{FG SHINE}INFORMATION TO DEVELOPERS@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It's very easy to support SysLog. All you need to do is to link your
application with the C link library (SAS/C or GCC). Then you can just
call the SysLog()-function to log messages. You can also use the
syslog.library directly.

You have to copy the include files in Developer drawer to correct
directories. If you're using SAS/C, then just copy the contents of
the include-directory to SC:include. If you're using GCC, copy to
GCC:os-include. You'll also have to copy the contents of GCC:os-include
directory to GCC:os-include.

There are a few example programs that will demonstrate how to use
SysLog.


@{FG SHINE}SYSLOG.LIBRARY@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

See the Developer directory for SysLog.autodoc.

Programs that want to listen to log messages are called spies. The
syslog.library redirects all messages to all spies. If there are no
spies, the messages are discarded.


@{FG SHINE}THE C LINK LIBRARY@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These functions are provided in the C link library:

  void SysLog(LONG priority, STRPTR message, ...)
  void VSysLog(LONG priority, STRPTR message, va list args)
  void OpenLog(STRPTR tag, LONG options, LONG facility)
  void CloseLog(void)
  int  SetLogMask(LONG mask)

The SysLog() function writes message to syslog.library, which redirects
it to all spies. 

The message is identical to a printf format string. Note that the '%m'
is not supported, although it is in the UNIX version. A trailing newline
is added if none is present. Maximum message length including time is
1024 characters.

The VSysLog() function is an alternate form in which the arguments have
already been captured using the variable-length argument facilities of
varargs.

The message is tagged with @{"priority" link FacLev}. Priorities are encoded as a facility
and a level. The facility describes the part of the system generating the
message.  The level is selected from the following ordered (high to low)
list:

    LOG_EMERG     A panic condition.

    LOG_ALERT     A condition that should be corrected immediately, such
                  as a corrupted system database.

    LOG_CRIT      Critical conditions, e.g., hard device errors.

    LOG_ERR       Errors.

    LOG_WARNING   Warning messages.

    LOG_NOTICE    Conditions that are not error conditions, but should
                  possibly be handled specially.

    LOG_INFO      Informational messages.

    LOG_DEBUG     Messages that contain information normally of use only
                  when debugging a program.

The OpenLog() function provides for more specialized processing of the
messages sent by SysLog() and VSysLog(). The parameter ident is a string
that will be prepended to every message. The options argument is a bit
field specifying logging options, which is formed by OR'ing one or more
of the following values:

    LOG_CONS      If SysLog() cannot pass the message to any spy it will
                  attempt to write the message to the console.

    LOG_PERROR    Write the message to standard error output as well to the
                  system log.

    LOG_PID       Log the process id with each message. The process number
                  is used here if Executive isn't running, in which case
                  PID is obtained from Executive.

IMPORTANT! The LOG_CONS and LOG_PERROR options can't be used when SysLog()
or VSysLog() is called from a task. LOG_PID can't be used when calling
from an interrupt or when multitasking is disabled.

The facility parameter encodes a default facility to be assigned to all
messages that do not have an explicit facility encoded:

     LOG_AUTH      The authorization system: login etc.

     LOG_AUTHPRIV  The same as LOG AUTH, but logged to a file readable
                   only by selected individuals.

     LOG_CRON      Cron utility

     LOG_DAEMON    System daemons/commodities.

     LOG_FTP       Ftp daemon.

     LOG_KERN      Messages generated by the system. 

     LOG_MAIL      The mail system.

     LOG_NEWS      The network news system.

     LOG_SYSLOG    Messages generated internally by SysLogDaemon.

     LOG_USER      Messages generated by user processes. This is the
                   default facility identifier if none is specified.

     LOG_UUCP      The uucp system.

     LOG_LOCAL0    Reserved for local use. Similarly for LOG_LOCAL1 through
                   LOG_LOCAL7.

The CloseLog() function is used after calling OpenLog().

The SetLogMask() function sets the log priority mask and returns the
previous mask. Calls to SysLog() with a priority not set in the new mask
are rejected. The mask for an individual priority pri is calculated by
the macro LOG_MASK(pri); the mask for all priorities up to and including
toppri is given by the macro LOG_UPTO(toppri);. The default allows all
priorities to be logged. Of course SetLogMask() only applies to the
current program.

EXAMPLES

  SysLog(LOG ALERT, "who: internal error 23");

  OpenLog("ftpd", LOG_PID, LOG_FTP);
  SetLogMask(LOG_UPTO(LOG_ERR));
  SysLog(LOG_INFO, "Connection from host %d", CallingHost);

@ENDNODE

@NODE Author "Author"

@{FG SHINE}AUTHOR@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@{B}Email@{UB}

  petrin@megabaud.fi
  petrin@sik.ppoy.fi

@{B}WWW@{UB}

  SysLog WWW page:

    http://www.megabaud.fi/~petrin/SysLog.html

  My homepage:

    http://www.megabaud.fi/~petrin

@{B}Snail mail@{UB}

  Petri Nordlund
  Vanhamaantie 4
  28800  PORI
  FINLAND

@{B}Telephone@{UB}

  +358-39-6480 322 (EET)

@{B}PGP@{UB}

For secure communication, please use my @{"PGP key" link PGP}.

@ENDNODE

@NODE PGP "PGP KEY"

@{FG SHINE}PGP key@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Below you will find my public key. Use a text editor to save it to disk
and follow the instructions on PGP manual for using it to send encrypted
email.

You can also obtain my PGP key by fingering one of my email addresses.

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6ui

mQCNAjBz1LwAAAEEALP5+1K/Mqbr7VDFrsL/W3Srp1hRfp5GbLid6Gn38/Zfb1PJ
hb/yDAuJX0G9nZ/hMBs7nXPVuUPZsf1iEeOuDW6U3MiqOrhau7mi6P05KqTW/xYY
fzTeZ+K6re1foR0+ScV4i0fYpMi/O4n+3uZGVGc4X/JSVQyHsTDgjUTe/EdpAAUR
tCNQZXRyaSBOb3JkbHVuZCA8cGV0cmluQG1lZ2FiYXVkLmZpPg==
=EBEO
-----END PGP PUBLIC KEY BLOCK-----
@ENDNODE

@NODE History "History"

@{FG SHINE}HISTORY@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@{FG SHINE}V1.00@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
First public release.

@ENDNODE

@NODE SysLogDaemon "SysLogDaemon"
@NEXT LOG

@{FG SHINE}SYSLOGDAEMON@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@{I}  Write log messages to disk/screen/serial port.@{UI}


@{"OPTIONS" link SysLogDaemon_Options}

@{B}DESCRIPTION@{UB}

  SysLogDaemon writes log messages to destinations specified in
  a configuration file. A destination can be:

    - file
    - console
    - serial port

  The configuration file, SysLogDaemon.conf is search first from
  directory where the program executable is and then from S: directory.

  The configuration file consists of lines with two fields: the @{I}selector@{UI}
  field which specifies the types of messages and priorities to which the
  line applies and an @{I}action@{UI} field which specifies the action to be taken
  if a message matches the selection criteria. The @{I}selector@{UI} field is
  separated from the @{I}action@{UI} field by one or more @{B}tab@{UB} characters.

  The @{I}selectors@{UI} function are encoded as a @{I}facility@{UI}, a period ("."), and a
  @{I}level@{UI}, with no intervening white-space. Both the @{I}facility@{UI} and the @{I}level@{UI}
  are case insensitive.

  The @{I}facility@{UI} describes the part of the system generating the message.
  The @{I}level@{UI} describes the severity of the message. 

  For further descriptions of both the @{I}facility@{UI} and @{I}level@{UI} keywords and
  their significance, see a list of @{"facilities and levels" link FacLev}.

  If a message matches the specified @{I}facility@{UI} and is of the specified
  @{I}level@{UI} (or a higher level), the action specified in the @{I}action@{UI} field will
  be taken.

  Multiple selectors may be specified for a single @{I}action@{UI} by separating
  them with semicolon (";") characters. It is important to note, however,
  that each @{I}selector@{UI} can modify the ones preceding it.

  Multiple @{I}facilities@{UI} may be specified for a single @{I}level@{UI} by separating
  with comma (",") characters.

  An asterisk ("*") can be used to specify all @{I}facilities@{UI} or all @{I}levels@{UI}.

  The special @{I}facility{UI} "mark" receives a message at @{I}level@{UI} "info"
  every 20 minutes. This is not enabled by a @{I}facility@{UI} field containing an
  asterisk.

  The special @{I}level@{UI} "none" disables a particular @{I}facility@{UI}.

  The @{I}action@{UI} field of each line specifies the action to be taken when the
  @{I}selector@{UI} field selects a message. There are three actions:

    - FILE    
    - CON
    - SERIAL

  Examples:

    FILE=T:debug.log
    FILE=s:messages

    CON                       (use default CON: 0/0/640/100/Log)
    CON=0/0/640/80/SysLogDaemon output

    SERIAL                    (serial.device, unit 0)
    SERIAL=artser.device      (artser.device, unit 0)
    SERIAL=artser.device/2    (artser.device, unit 2)

  Files are not kept open by SysLogDaemon, so you can read them and
  edit them while SysLogDaemon is running. If you want a CON-window that
  can be closed, use this action:

    FILE=CON:20/40/600/140/===CRITICAL SITUATION===/AUTO/WAIT

  Only one message will be printed to this window. You can close the
  window when you have read the message.

  Serial transfer is done at 9600bps 8 bits, no parity, one stop bit.

  Blank lines and lines whose first non-blank character is a hash ("#")
  character are ignored.

  A configuration file might appear as follows:


    # Log all messages from cron to one file
    cron.*                                       FILE=SYS:cron.log

    # Log all kernel/system messages, authentication messages of
    # level notice or higher and anything of level err or higher 
    # to a console.
    # Don't log private authentication messages!
    *.err;kern.*;auth.notice;authpriv.none       CON
  
    # Log anything (except mail) of level info or higher.
    # Don't log private authentication messages!
    *.info;mail.none;authpriv.none               FILE=s:messages
  
    # Log all authpriv-level messages to a secure drive
    authpriv.*                                   FILE=SECURE:authpriv.log


   The effects of multiple selectors are sometimes not intuitive. For
   example "mail.crit,*.err" will select "mail" facility messages at the
   level of "err" or higher, not at the level of "crit" or higher.

@ENDNODE


@NODE SysLogDaemon_Options "SysLogDaemon options"

@{FG SHINE}SYSLOGDAEMON OPTIONS@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@{B}CONFIG@{UB}

  Template:  -f=CONFIG/K
  Tooltype:  CONFIG
  Default:   PROGDIR:SysLogDaemon.conf, S:SysLogDaemon.conf

  Name of the configuration file.

@{B}MARK@{UB}

  Template:  -m=MARK/N/K
  Tooltype:  MARK
  Default:   PROGDIR:SysLogDaemon.conf, S:SysLogDaemon.conf

  Number of minutes between "mark" messages. The default is 20 minutes.

@{B}QUIT@{UB}

  Template:  -q=QUIT/S
  Tooltype:  QUIT

  Quit SysLogDaemon if it's running.

@{B}VERSION@{UB}

  Template:  -v=VERSION/S
  Tooltype:  -

  Display version number.

@ENDNODE

@NODE LOG "LOG:"
@PREV SysLogDaemon
@NEXT logger

@{FG SHINE}LOG:@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@{I}  LOG: device.@{UI}


@{B}DESCRIPTION@{UB}

  Everything that you write to LOG: device is logged to system log.
  LOG: can be very useful when you want to log the output of some
  program, for example a cron utility.

  For example:

    Cron >LOG:

  You can also specify a @{"priority" LINK FacLev} and tag for all messages:

    Cron >LOG:cron.info/cron
    Cron >LOG:cron.info
    Cron >LOG:/cron

  Here cron.info is the priority and cron is the tag.

@ENDNODE

@NODE logger "logger"
@PREV LOG
@NEXT newsyslog

@{FG SHINE}LOGGER@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@{I}  Make entries in the system log.@{UI}


@{"OPTIONS" link logger_Options}

@{B}DESCRIPTION@{UB}

  Logger let's users log messages to system log. For example:

    logger System rebooted

  Creates a message like this:

    Nov 03 18:42:24 logger: System rebooted

  A priority and a tag can be given:

    logger PRI=user.notice TAG=User Test message

  Produces:

    Nov 03 18:43:05 User: Test message

  If no message is given, message will be read from standard input.
  CTRL-D terminates input.


@{B}EXAMPLES@{UB}

  @{"logger Test message" SYSTEM "logger Test message >CON:0/0/640/200/Output/CLOSE/WAIT"}

  @{"logger PRI=user.notice TAG=User Test message" SYSTEM "logger PRI=user.notice TAG=User Test message >CON:0/0/640/200/Output/CLOSE/WAIT"}

@ENDNODE


@NODE logger_Options "logger options"

@{FG SHINE}LOGGER OPTIONS@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@{B}FILE@{UB}

  Template:  -f=FILE/K
  Tooltype:  FILE

  Log the specified file.

@{B}PRI@{UB}

  Template:  -p=PRI/K
  Tooltype:  PRI

  Enter the message with specified priority. The priority may be specified
  numerically or as a "facility.level" pair.

  See the list of @{"facilities and levels" LINK FacPri}.

@{B}TAG@{UB}

  Template:  -t=TAG/K
  Tooltype:  TAG

  Mark every message with the specified tag.

@{B}PID@{UB}

  Template:  -p=PID/K
  Tooltype:  PID

  Log the process number of the logger process with each line.

  SysLog obtains the PID from Executive, if it's running.

@{B}STDERR@{UB}

  Template:  -s=STDERR/K
  Tooltype:  STDERR

  Log the message to standard error, as well as the system log.

@{B}VERSION@{UB}

  Template:  -v=VERSION/S
  Tooltype:  -

  Display version number.

@{B}MESSAGE@{UB}

  Template:  MESSAGE/F
  Tooltype:  MESSAGE

  Write this message to log. If not specified, and the FILE-option is
  not provided, standard input is logged.

@ENDNODE

@NODE newsyslog "newsyslog"
@PREV logger

@{FG SHINE}NEWSYSLOG@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@{I}  Maintain system log files to manageable sizes.@{UI}


@{"OPTIONS" link newsyslog_Options}

@{B}DESCRIPTION@{UB}

  Newsyslog is a program that should be scheduled to run periodically by
  a cron utility. When it is executed it archives log files if necessary.
  If a log file is determined to require archiving, newsyslog rearranges
  the files so that "logfile" is empty, "logfile.0" has the last period's
  logs in it, "logfile.1" has the next to last  period's logs in it, and
  so on, up to a user-specified number of archived logs. Optionally the
  archived logs can be compressed to save space.

  A log can be archived because of two reasons. The log file can have
  grown bigger than a preset size in kilo-bytes, or a preset number
  of hours may have elapsed since the last log archive. The granularity
  of newsyslog is dependent on how often it is scheduled to run by cron.
  Since the program is quite fast, it may be scheduled to run every hour
  without any ill effects.

  When starting up, newsyslog reads in a configuration file to determine
  which logs should be looked at. By  default, this configuration file
  is searched from the directory where the program executable is. The
  file is also searched from S: directory. The configuration file is
  called "newsyslog.conf". Each line of the file contains information
  about a particular log file that should be handled by newsyslog.
  Each line has four mandatory fields and one optional field, with a
  whitespace separating each field. Blank lines or lines beginning with
  "#" are ignored. The fields of the configuration file are as follows:

    logfile name
    number of archives
    size of archives
    archive interval
    flags (optional)

  The logfile name entry is the name of the system log file to be
  archived.

  The number of archives entry specifies the number of archives to be
  kept besides the log file itself.

  When the size of the logfile reaches size of archives, the logfile
  becomes trimmed as described above. If this field is replaced by a
  "*", then the size of the logfile is not taken into account when
  determining when to trim the log file.

  The number of hours entry specifies the time separation between the
  trimming of the log file. If this field is replaced by a "*", then
  the number of hours since the last time the log was trimmed will not
  be taken into consideration.

  The flags field specifies if the archives should have any special
  processing done to the archived  log  files.  The "Z" flag will
  make the archive files compressed to save space using gzip, which
  has to be in the system search path. The "B" flag means that the
  file is a binary file, and so the ASCII message which newsyslog
  inserts to indicate the fact that the logs have been turned over
  should not be included.


@{B}EXAMPLES@{UB}

  Just show what would be done:

  @{"newsyslog NOACTION VERBOSE" SYSTEM "newsyslog NOACTION VERBOSE >CON:0/0/640/200/Output/CLOSE/WAIT"}

@ENDNODE


@NODE newsyslog_Options "newsyslog options"

@{FG SHINE}NEWSYSLOG OPTIONS@{FG TEXT}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@{B}CONFIG@{UB}

  Template:  -f=CONFIG/K
  Tooltype:  CONFIG
  Default:   PROGDIR:newsyslog.conf, S:newsyslog.conf

  Name of the configuration file.

@{B}NOACTION@{UB}

  Template:  -n=NOACTION/S
  Tooltype:  NOACTION

  Causes newsyslog not to trim the logs, but to print out what it
  would do if this option were not specified.

@{B}VERBOSE@{UB}

  Template:  -v=VERBOSE/S
  Tooltype:  VERBOSE

  Places newsyslog in verbose mode. In this mode it will print out each
  log and its reasons for either trimming that log or skipping it.

@{B}VERSION@{UB}

  Template:  -ver=VERSION/S
  Tooltype:  -

  Display version number.

@ENDNODE
