<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Syslog" rel="Chapter" href="Syslog.html"><title>Syslog</title> </head> <body> <div class="navbar"> <a href="index.html">Up</a> </div> <center><h1>Module <a href="type_Syslog.html">Syslog</a></h1></center> <br> <pre><span class="keyword">module</span> Syslog: <code class="code">sig</code> <a href="Syslog.html">..</a> <code class="code">end</code></pre>Syslog routines<br> <hr width="100%"> <br> These are loosely based on the unix syslog(3) function and relatives.<br> <pre><span class="keyword">type</span> <a name="TYPEfacility"></a><code class="type"></code>facility = <code class="type">[ `LOG_AUTH<br> | `LOG_AUTHPRIV<br> | `LOG_CONSOLE<br> | `LOG_CRON<br> | `LOG_DAEMON<br> | `LOG_FTP<br> | `LOG_KERN<br> | `LOG_LOCAL0<br> | `LOG_LOCAL1<br> | `LOG_LOCAL2<br> | `LOG_LOCAL3<br> | `LOG_LOCAL4<br> | `LOG_LOCAL5<br> | `LOG_LOCAL6<br> | `LOG_LOCAL7<br> | `LOG_LPR<br> | `LOG_MAIL<br> | `LOG_NEWS<br> | `LOG_NTP<br> | `LOG_SECURITY<br> | `LOG_SYSLOG<br> | `LOG_USER<br> | `LOG_UUCP ]</code> </pre> <div class="info"> The assorted logging facilities. The default is <code class="code">`LOG_USER</code>. You can set a new default with openlog, or give a specific facility per syslog call.<br> </div> <pre><span class="keyword">type</span> <a name="TYPEflag"></a><code class="type"></code>flag = <code class="type">[ `LOG_CONS | `LOG_PERROR | `LOG_PID ]</code> </pre> <div class="info"> Flags to pass to openlog. <code class="code">`LOG_CONS</code> isn't implemented yet. LOG_NDELAY is mandatory and implied<br> </div> <pre><span class="keyword">type</span> <a name="TYPElevel"></a><code class="type"></code>level = <code class="type">[ `LOG_ALERT<br> | `LOG_CRIT<br> | `LOG_DEBUG<br> | `LOG_EMERG<br> | `LOG_ERR<br> | `LOG_INFO<br> | `LOG_NOTICE<br> | `LOG_WARNING ]</code> </pre> <div class="info"> The priority of the error.<br> </div> <pre><span class="keyword">type</span> <a name="TYPEt"></a><code class="type"></code>t </pre> <div class="info"> the type of a syslog connection<br> </div> <pre><span class="keyword">val</span> <a name="VALfacility_of_string"></a>facility_of_string : <code class="type">string -> <a href="Syslog.html#TYPEfacility">facility</a></code></pre><div class="info"> given a string descibing a facility, return the facility. The strings consist of the name of the facility with the LOG_ chopped off. They are not case sensitive.<br> <b>Raises</b> <code>Syslog_error</code> when given an invalid facility<br> </div> <pre><span class="keyword">val</span> <a name="VALopenlog"></a>openlog : <code class="type">?logpath:string -><br> ?facility:<a href="Syslog.html#TYPEfacility">facility</a> -> ?flags:<a href="Syslog.html#TYPEflag">flag</a> list -> string -> <a href="Syslog.html#TYPEt">t</a></code></pre><div class="info"> openlog ?(logpath=AUTODETECTED) ?(facility=`LOG_USER) ?(flags=[]) program_name, similar to openlog(3)<br> <b>Raises</b> <code>Syslog_error</code> on error<br> </div> <pre><span class="keyword">val</span> <a name="VALsyslog"></a>syslog : <code class="type">?fac:<a href="Syslog.html#TYPEfacility">facility</a> -> <a href="Syslog.html#TYPEt">t</a> -> <a href="Syslog.html#TYPElevel">level</a> -> string -> unit</code></pre><div class="info"> Same as syslog(3), except there's no formats.<br> <b>Raises</b> <code>Syslog_error</code> on error (very rare)<br> </div> <pre><span class="keyword">val</span> <a name="VALcloselog"></a>closelog : <code class="type"><a href="Syslog.html#TYPEt">t</a> -> unit</code></pre><div class="info"> Close the log.<br> <b>Raises</b> <code>Syslog_error</code> on error<br> </div> </body></html>