\item Add a epicsEnvSet command to your IOC startup file. For example
402
402
403
403
\begin{verbatim}
404
ld < iocCore
404
ld < iocCore
405
405
epicsEnvSet("EPICS_IOC_LOG_INET=xxx.xxx.xxx.xxx")
406
406
\end{verbatim}
407
407
410
410
\item On your host workstation, start the log server.
411
411
412
412
\end{itemize}
413
414
\subsection{iocLogPrefix}
415
\label{iocLogPrefix}
416
\index{iocLogPrefix}
417
418
Many sites run multiple soft IOCs on the same machine.
419
With some log viewers like cmlogviewer it is not possible to distinguish between the log messages from these IOCs since their hostnames are all the same.
420
One solution to this is to add a unique prefix to every log message.
421
422
The \verb|iocLogPrefix| command can be run from the startup file during IOC initialization to establish such a prefix that will be prepended to every log message when it is sent to the iocLogServer.
423
424
For example, adding the following lines to your \verb|st.cmd| file
425
426
\begin{verbatim}
427
epicsEnvSet("IOC","sioc-b34-mc10");
428
iocLogPrefix("fac=LI21 proc=${IOC} ");
429
\end{verbatim}
430
431
will categorize all log messages from this IOC as belonging to the facility \verb|LI21| and to the process \verb|sioc-b34-mc10|.
432
433
Note that log messages echoed to the IOC's standard output will not show the prefix, it only appears in the version sent to the log server.
434
\verb|iocLogPrefix| should appear fairly early in the startup script so the IOC doesn't try to send any log messages without the prefix.
435
Once the prefix has been set, it cannot be changed without rebooting the IOC.
436
One can determine if a log prefix has been set using \verb|iocLogShow|.