����JFIF��H�H�����C� %# , #&')*)-0-(0%()(���C (((((((((((((((((((((((((((((((((((((((((((((((((((�������������������������������������������������P������������������������A�!)10������""������"*��@��������#+�OK&������2�Ec�xo����"�P��B}���������������������:9:9=<G$���S,�"5�R2�i��ғ��3ʥ�3@�;":%885I@��e� E��"�H�Z���ς�Z9 .��������[+��M�������������������,��������0" !1234#$5@P`�������?�$|�,.,���1�:�Q��<(���Q�Xi�*3���|T��}h�� L,I�V��|�hoZ��9��ȅ*�+�%��Y_�|5fcq�A�<���"8#_i���x���|�pۨ��p�+a�Q�uoŝȡ`sޚ5�n���.�:v��]�Mk��E�Gh�Ѐ"��B���i�f�<��O:��J�ԍ]o�҈g��Zz�!Xg{<6R�{�x'��`M����?�[Z�ط#5y�t�L�7S�) �vX���^�݈���;=�@^���Ƽ��� �� h��5� ���\��������������������������?4������������������������?4�����4� �������!1"02AQqa 3B��#@P`r��������?��f`��Y�ʉ�j����Zkx��@N�JaS������}����r��t��SɁ�3�p�e��W*͎�z4v\�c����`zdg�dGu3�� ��=�2p*��#��l�9�<���A���Pu��k�������8� � �4k*;���������8���2�b��VӋE�t�[0�kmli�㵑39�i����2��o} mM����kF \�:2�+w{{���-��$xVRkEA�N�]�^�R�[ryeV�G*G4��m�mӃ�N�!��hF�v��I�R��D�_�Q�p��T[l��D�.nNӢ����O��˚�i7+�=�=8qJ���'����K�B{���K�͟e�5���:����e��1��w�m��[MA���č��Vj��mȵ�z)�� č��}��n�(���9��?���)��������!1AQ0aq��� ��@�P`����?!��@v�,c�֟$M��6_���⠾SD$��!�/Y��:�NQ���!�c(��^��b�y��u��+�.H�U$�%嗗��ry�N>��]����X0�2D�q�q}Z��˥4ao����M,E�؇Uq� �Ϙc�AC\��:�+R��-�/9�Z �O�A*��|��+,u�~�#G �B" ���D�X1��_�VwP���OY��"�d��+V�a�\�t�v�^��[��j�c3�^�f4 KTFS��cNI��F���x1F9 �m��@��YڭQ�+(��D��Dߵ[���$�M���&��D�Z�V��&ձGi�@�t}�к�/+�4����wd0Dh���� ��aa�M='�g�UK�M��7�M+�O}�� ��4�r�ԋ�t��g\F,0���k��aX���U� ��5y��6�@�2�� ��DmZ�V{�9]A�.m�EKZ��2 ���?���������I$�I$�I$�I$�I$�I$�I$�I$A$�I$�@$I$�I I$�I ��$�I$�I$I$�II$�I$� �I$�I$�I$�I�A$�I$� �I$��$�I @�I$�$�I$�I �@$�I$�I$�I$�I$�I$�����������������������?4������������������������?4�����+��������!1AQ�aq�0����� ��@P`����?�����(Ir��ʲo��(��#)�0�a �?&�4�0�~��4Տ���K�Fhg~�����թ̛]NH ����}��N��:��5{y���o�BNb���s������C��t��kM�)j*D��$<�������gN���C��s%A#�*��=�@`䠴�?T+�U}�b��ʩ� D+�ϪG����!������j_�*)C�_ЂG�%�ү�4�X��T���IH������0r�"�%\~�%aJ��3�����iԁ �_�!�G�d ;�O�=$ VXx�� ����B�KSZtk�&�#��)�p0�P��Q.��M�9!�ۋne)��ҧ����4'��4$��)�F�^�v��� ��1j�f�z�U�K0�m�V=AA&C����"��gzu%�`08[^���Us���7��нWźU��� �z����4)B��e-�HV%Hh7�ԑ��A(�>hP��\�%a�[lL�_n{Ґ���V4n�FX�D+��1Kt�Z��\��!2��)Y��9�Em8�,��_WeD3¢���a��zW��L�3���d^-�����A��}�Y�g�(A�бx�P>ƌH��ߤ;Vn�q������JH� ?�� A�0�H��E�������jV�U��&H����� ��I�b&3�MF@H��L�E� CV-k6 �T:W���&3y��-օ�cB�6�#�h�VL{Q�0 ���Y��
One Hat Cyber Team
One Hat Cyber Team
Your IP :
18.118.115.222
Server IP :
167.114.57.54
Server :
Linux vps.riaoverseas.com 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64
Server Software :
Apache
PHP Version :
8.0.18
Buat File
|
Buat Folder
Dir :
~
/
usr
/
share
/
doc
/
python-docs-2.7.5
/
html
/
library
/
View File Name :
syslog.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>35.15. syslog — Unix syslog library routines — Python 2.7.5 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '2.7.5', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/sidebar.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within Python 2.7.5 documentation" href="../_static/opensearch.xml"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="copyright" title="Copyright" href="../copyright.html" /> <link rel="top" title="Python 2.7.5 documentation" href="../index.html" /> <link rel="up" title="35. Unix Specific Services" href="unix.html" /> <link rel="next" title="35.16. commands — Utilities for running commands" href="commands.html" /> <link rel="prev" title="35.14. nis — Interface to Sun’s NIS (Yellow Pages)" href="nis.html" /> <link rel="shortcut icon" type="image/png" href="../_static/py.png" /> <script type="text/javascript" src="../_static/copybutton.js"></script> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="commands.html" title="35.16. commands — Utilities for running commands" accesskey="N">next</a> |</li> <li class="right" > <a href="nis.html" title="35.14. nis — Interface to Sun’s NIS (Yellow Pages)" accesskey="P">previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="http://www.python.org/">Python</a> »</li> <li> <a href="../index.html">Python 2.7.5 documentation</a> » </li> <li><a href="index.html" >The Python Standard Library</a> »</li> <li><a href="unix.html" accesskey="U">35. Unix Specific Services</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="module-syslog"> <span id="syslog-unix-syslog-library-routines"></span><h1>35.15. <a class="reference internal" href="#module-syslog" title="syslog: An interface to the Unix syslog library routines. (Unix)"><tt class="xref py py-mod docutils literal"><span class="pre">syslog</span></tt></a> — Unix syslog library routines<a class="headerlink" href="#module-syslog" title="Permalink to this headline">¶</a></h1> <p>This module provides an interface to the Unix <tt class="docutils literal"><span class="pre">syslog</span></tt> library routines. Refer to the Unix manual pages for a detailed description of the <tt class="docutils literal"><span class="pre">syslog</span></tt> facility.</p> <p>This module wraps the system <tt class="docutils literal"><span class="pre">syslog</span></tt> family of routines. A pure Python library that can speak to a syslog server is available in the <a class="reference internal" href="logging.handlers.html#module-logging.handlers" title="logging.handlers: Handlers for the logging module."><tt class="xref py py-mod docutils literal"><span class="pre">logging.handlers</span></tt></a> module as <tt class="xref py py-class docutils literal"><span class="pre">SysLogHandler</span></tt>.</p> <p>The module defines the following functions:</p> <dl class="function"> <dt id="syslog.syslog"> <tt class="descclassname">syslog.</tt><tt class="descname">syslog</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#syslog.syslog" title="Permalink to this definition">¶</a></dt> <dt> <tt class="descclassname">syslog.</tt><tt class="descname">syslog</tt><big>(</big><em>priority</em>, <em>message</em><big>)</big></dt> <dd><p>Send the string <em>message</em> to the system logger. A trailing newline is added if necessary. Each message is tagged with a priority composed of a <em>facility</em> and a <em>level</em>. The optional <em>priority</em> argument, which defaults to <tt class="xref py py-const docutils literal"><span class="pre">LOG_INFO</span></tt>, determines the message priority. If the facility is not encoded in <em>priority</em> using logical-or (<tt class="docutils literal"><span class="pre">LOG_INFO</span> <span class="pre">|</span> <span class="pre">LOG_USER</span></tt>), the value given in the <a class="reference internal" href="#syslog.openlog" title="syslog.openlog"><tt class="xref py py-func docutils literal"><span class="pre">openlog()</span></tt></a> call is used.</p> <p>If <a class="reference internal" href="#syslog.openlog" title="syslog.openlog"><tt class="xref py py-func docutils literal"><span class="pre">openlog()</span></tt></a> has not been called prior to the call to <a class="reference internal" href="#module-syslog" title="syslog: An interface to the Unix syslog library routines. (Unix)"><tt class="xref py py-func docutils literal"><span class="pre">syslog()</span></tt></a>, <tt class="docutils literal"><span class="pre">openlog()</span></tt> will be called with no arguments.</p> </dd></dl> <dl class="function"> <dt id="syslog.openlog"> <tt class="descclassname">syslog.</tt><tt class="descname">openlog</tt><big>(</big><span class="optional">[</span><em>ident</em><span class="optional">[</span>, <em>logoption</em><span class="optional">[</span>, <em>facility</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#syslog.openlog" title="Permalink to this definition">¶</a></dt> <dd><p>Logging options of subsequent <a class="reference internal" href="#module-syslog" title="syslog: An interface to the Unix syslog library routines. (Unix)"><tt class="xref py py-func docutils literal"><span class="pre">syslog()</span></tt></a> calls can be set by calling <a class="reference internal" href="#syslog.openlog" title="syslog.openlog"><tt class="xref py py-func docutils literal"><span class="pre">openlog()</span></tt></a>. <a class="reference internal" href="#module-syslog" title="syslog: An interface to the Unix syslog library routines. (Unix)"><tt class="xref py py-func docutils literal"><span class="pre">syslog()</span></tt></a> will call <a class="reference internal" href="#syslog.openlog" title="syslog.openlog"><tt class="xref py py-func docutils literal"><span class="pre">openlog()</span></tt></a> with no arguments if the log is not currently open.</p> <p>The optional <em>ident</em> keyword argument is a string which is prepended to every message, and defaults to <tt class="docutils literal"><span class="pre">sys.argv[0]</span></tt> with leading path components stripped. The optional <em>logoption</em> keyword argument (default is 0) is a bit field – see below for possible values to combine. The optional <em>facility</em> keyword argument (default is <tt class="xref py py-const docutils literal"><span class="pre">LOG_USER</span></tt>) sets the default facility for messages which do not have a facility explicitly encoded.</p> </dd></dl> <dl class="function"> <dt id="syslog.closelog"> <tt class="descclassname">syslog.</tt><tt class="descname">closelog</tt><big>(</big><big>)</big><a class="headerlink" href="#syslog.closelog" title="Permalink to this definition">¶</a></dt> <dd><p>Reset the syslog module values and call the system library <tt class="docutils literal"><span class="pre">closelog()</span></tt>.</p> <p>This causes the module to behave as it does when initially imported. For example, <a class="reference internal" href="#syslog.openlog" title="syslog.openlog"><tt class="xref py py-func docutils literal"><span class="pre">openlog()</span></tt></a> will be called on the first <a class="reference internal" href="#module-syslog" title="syslog: An interface to the Unix syslog library routines. (Unix)"><tt class="xref py py-func docutils literal"><span class="pre">syslog()</span></tt></a> call (if <a class="reference internal" href="#syslog.openlog" title="syslog.openlog"><tt class="xref py py-func docutils literal"><span class="pre">openlog()</span></tt></a> hasn’t already been called), and <em>ident</em> and other <a class="reference internal" href="#syslog.openlog" title="syslog.openlog"><tt class="xref py py-func docutils literal"><span class="pre">openlog()</span></tt></a> parameters are reset to defaults.</p> </dd></dl> <dl class="function"> <dt id="syslog.setlogmask"> <tt class="descclassname">syslog.</tt><tt class="descname">setlogmask</tt><big>(</big><em>maskpri</em><big>)</big><a class="headerlink" href="#syslog.setlogmask" title="Permalink to this definition">¶</a></dt> <dd><p>Set the priority mask to <em>maskpri</em> and return the previous mask value. Calls to <a class="reference internal" href="#module-syslog" title="syslog: An interface to the Unix syslog library routines. (Unix)"><tt class="xref py py-func docutils literal"><span class="pre">syslog()</span></tt></a> with a priority level not set in <em>maskpri</em> are ignored. The default is to log all priorities. The function <tt class="docutils literal"><span class="pre">LOG_MASK(pri)</span></tt> calculates the mask for the individual priority <em>pri</em>. The function <tt class="docutils literal"><span class="pre">LOG_UPTO(pri)</span></tt> calculates the mask for all priorities up to and including <em>pri</em>.</p> </dd></dl> <p>The module defines the following constants:</p> <dl class="docutils"> <dt>Priority levels (high to low):</dt> <dd><tt class="xref py py-const docutils literal"><span class="pre">LOG_EMERG</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_ALERT</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_CRIT</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_ERR</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_WARNING</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_NOTICE</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_INFO</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_DEBUG</span></tt>.</dd> <dt>Facilities:</dt> <dd><tt class="xref py py-const docutils literal"><span class="pre">LOG_KERN</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_USER</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_MAIL</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_DAEMON</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_AUTH</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_LPR</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_NEWS</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_UUCP</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_CRON</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_SYSLOG</span></tt> and <tt class="xref py py-const docutils literal"><span class="pre">LOG_LOCAL0</span></tt> to <tt class="xref py py-const docutils literal"><span class="pre">LOG_LOCAL7</span></tt>.</dd> <dt>Log options:</dt> <dd><tt class="xref py py-const docutils literal"><span class="pre">LOG_PID</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_CONS</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_NDELAY</span></tt>, <tt class="xref py py-const docutils literal"><span class="pre">LOG_NOWAIT</span></tt> and <tt class="xref py py-const docutils literal"><span class="pre">LOG_PERROR</span></tt> if defined in <tt class="docutils literal"><span class="pre"><syslog.h></span></tt>.</dd> </dl> <div class="section" id="examples"> <h2>35.15.1. Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> <div class="section" id="simple-example"> <h3>35.15.1.1. Simple example<a class="headerlink" href="#simple-example" title="Permalink to this headline">¶</a></h3> <p>A simple set of examples:</p> <div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">syslog</span> <span class="n">syslog</span><span class="o">.</span><span class="n">syslog</span><span class="p">(</span><span class="s">'Processing started'</span><span class="p">)</span> <span class="k">if</span> <span class="n">error</span><span class="p">:</span> <span class="n">syslog</span><span class="o">.</span><span class="n">syslog</span><span class="p">(</span><span class="n">syslog</span><span class="o">.</span><span class="n">LOG_ERR</span><span class="p">,</span> <span class="s">'Processing started'</span><span class="p">)</span> </pre></div> </div> <p>An example of setting some log options, these would include the process ID in logged messages, and write the messages to the destination facility used for mail logging:</p> <div class="highlight-python"><div class="highlight"><pre><span class="n">syslog</span><span class="o">.</span><span class="n">openlog</span><span class="p">(</span><span class="n">logoption</span><span class="o">=</span><span class="n">syslog</span><span class="o">.</span><span class="n">LOG_PID</span><span class="p">,</span> <span class="n">facility</span><span class="o">=</span><span class="n">syslog</span><span class="o">.</span><span class="n">LOG_MAIL</span><span class="p">)</span> <span class="n">syslog</span><span class="o">.</span><span class="n">syslog</span><span class="p">(</span><span class="s">'E-mail processing initiated...'</span><span class="p">)</span> </pre></div> </div> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../contents.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">35.15. <tt class="docutils literal"><span class="pre">syslog</span></tt> — Unix syslog library routines</a><ul> <li><a class="reference internal" href="#examples">35.15.1. Examples</a><ul> <li><a class="reference internal" href="#simple-example">35.15.1.1. Simple example</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="nis.html" title="previous chapter">35.14. <tt class="docutils literal"><span class="pre">nis</span></tt> — Interface to Sun’s NIS (Yellow Pages)</a></p> <h4>Next topic</h4> <p class="topless"><a href="commands.html" title="next chapter">35.16. <tt class="docutils literal"><span class="pre">commands</span></tt> — Utilities for running commands</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../bugs.html">Report a Bug</a></li> <li><a href="../_sources/library/syslog.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="commands.html" title="35.16. commands — Utilities for running commands" >next</a> |</li> <li class="right" > <a href="nis.html" title="35.14. nis — Interface to Sun’s NIS (Yellow Pages)" >previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="http://www.python.org/">Python</a> »</li> <li> <a href="../index.html">Python 2.7.5 documentation</a> » </li> <li><a href="index.html" >The Python Standard Library</a> »</li> <li><a href="unix.html" >35. Unix Specific Services</a> »</li> </ul> </div> <div class="footer"> © <a href="../copyright.html">Copyright</a> 1990-2020, Python Software Foundation. <br /> The Python Software Foundation is a non-profit corporation. <a href="http://www.python.org/psf/donations/">Please donate.</a> <br /> Last updated on Oct 13, 2020. <a href="../bugs.html">Found a bug</a>? <br /> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>