Normal Flow: The infoLoggerReader, infoLoggerServer and libInfo are
all running and connected to one another successfully. Log messages will
pass from libInfo to the infoLoggerReader over a local Unix socket.
From the infoLoggerReader the messages will be sent over TCP/IP to the
infoLoggerServer. The infoLoggerServer will then inject the log message into
a MySQL database.
Alternate Flow 1: If the infoLoggerServer is not running, or a
connection cannot be made, or a connection is lost.
Log messages will pass from libInfo to infoLoggerReader who will write them to
$DATE_SITE_LOGS/infoLoggerReader@host.
The infoLoggerReader will keep trying to connect to the infoLoggerServer,
if a connection is made then log messages
will now follow the 'Normal Flow'.
Alternate Flow 2: If the infoLoggerReader is not running, or
libInfo cannot connect to it, libinfo will try to start the infoLoggerReader.
But if it still cannot connect log messages will be written to
$DATE_SITE_LOGS/libInfo.msg@host by libInfo. libInfo will keep trying to
connect to the infoLoggerReader and if a connection is made then the messages willnow follow the 'Normal Flow'. libInfo will try to connect to infoLoggerReader at the start for 5 seconds before logging to the local file.
$DATE_SITE_LOGS/infoLoggerReaderLog@host: This file will
contain log messages created by the infoLoggerReader. It will have
messages concerning the connection status with the infoLoggerServer.
$DATE_SITE_LOGS/libInfo.err-pid@host: This file will contain
log messages created by libInfo when an error has occured. For
instance when a malloc for a log message fails the log message will
be written to this file. It will also have error messages concerning
connecting to the infoLoggerReader.
In the event that $DATE_SITE_LOGS is not defined all log files from
libInfo and infoLoggerReader will be placed in /tmp
infoOpen(): This will initialize libInfo and establish a
connection to the infoLoggerReader or a file on disk if it is not
available. NOTE trying to connect to infoLoggerReader will not time
out for 5 seconds, so this will block your program until a connection
is made or the 5 second timeout is reached. Though this will
happen also when you first log a message and haven't previously called
infoOpen().
infoLog_f(): This gives printf style log messages, you specify the facility and severity then the message like a printf string and then the variables to be supstituted into it.
eg infoLog_f(LOG_FACILITY,'I',"%s %d\n",mymesg,myint);
NOTE: All previous infoLogger log functions are implemented.
usage: infoLoggerReader [options] -p < port > Server port number to connect to infoLoggerServer. -s < host > Server hostname that you want to connect to. -u < unix socket > Unix Socket to use between client and reader. -d Turn on debug mode. -l < logfile > Set what file to log personal log messages to. -o Print personal log messages to stdout. This causes the infoLoggerReader not to run in daemon mode. -h This usage message. Do not use -l and -o together, otherwise only the last occurence is used. Make sure the following environment variables are set: DATE_SOCKET_INFOLOG_RX - port number to connect to infoLoggerServer or use -p option DATE_INFOLOGGER_LOGHOST - Hostname of infoLoggerServer eg pcald10, or use -s option