<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Omero logging &mdash; OMERO  documentation</title>
      <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/sphinx_highlight.js"></script>
    <script src="../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Graph requests" href="Server/GraphRequests.html" />
    <link rel="prev" title="Exception handling" href="Modules/ExceptionHandling.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
            <a href="../index.html" class="icon icon-home"> OMERO
          </a>
              <div class="version">
                5.6
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../users/index.html">OMERO Overview and CLI User Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sysadmins/index.html">System Administrator Documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Developer Documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="index.html#introduction-to-omero">Introduction to OMERO</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#using-the-omero-api">Using the OMERO API</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#analysis">Analysis</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#scripts-plugins-for-omero">Scripts - plugins for OMERO</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#web">Web</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#insight">Insight</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html#more-on-api-usage">More on API Usage</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="GettingStarted/AdvancedClientDevelopment.html">Developing OMERO clients</a></li>
<li class="toctree-l3"><a class="reference internal" href="Modules/Api.html">OMERO Application Programming Interface</a></li>
<li class="toctree-l3"><a class="reference internal" href="Modules/Api/AdminInterface.html">OMERO admin interface</a></li>
<li class="toctree-l3"><a class="reference internal" href="Modules/Delete.html">Deleting in OMERO</a></li>
<li class="toctree-l3"><a class="reference internal" href="Clients/ImportLibrary.html">OMERO Import Library</a></li>
<li class="toctree-l3"><a class="reference internal" href="Modules/TempFileManager.html">TempFileManager</a></li>
<li class="toctree-l3"><a class="reference internal" href="Modules/ExceptionHandling.html">Exception handling</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Omero logging</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#java-clients">Java clients</a></li>
<li class="toctree-l4"><a class="reference internal" href="#java-servers">Java servers</a></li>
<li class="toctree-l4"><a class="reference internal" href="#python-servers">Python servers</a></li>
<li class="toctree-l4"><a class="reference internal" href="#stdout-and-stderr">stdout and stderr</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="Server/GraphRequests.html">Graph requests</a></li>
<li class="toctree-l3"><a class="reference internal" href="Server/GraphsMigration.html">Rewriting old graph requests</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="index.html#the-ome-data-model">The OME Data Model</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#searching">Searching</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#authentication-and-security">Authentication and Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#omero-server-in-depth">OMERO.server in depth</a></li>
</ul>
</li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">OMERO</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home"></a></li>
          <li class="breadcrumb-item"><a href="index.html">Developer Documentation</a></li>
      <li class="breadcrumb-item active">Omero logging</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/developers/logging.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="omero-logging">
<h1>Omero logging<a class="headerlink" href="#omero-logging" title="Permalink to this heading"></a></h1>
<p>All OMERO components written in Java use the
<a class="reference external" href="https://www.slf4j.org">SLF4J</a> logging facade, typically backed
by <a class="reference external" href="https://logback.qos.ch/">Logback</a>; all
components written in python use the built-in <code class="docutils literal notranslate"><span class="pre">logging</span></code> module.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Refrain from calling <code class="docutils literal notranslate"><span class="pre">logging.basicConfig()</span></code> anywhere in your
module except in <code class="docutils literal notranslate"><span class="pre">if</span> <span class="pre">__name__</span> <span class="pre">==</span> <span class="pre">&quot;__main__&quot;</span></code> blocks.</p>
</div>
<section id="java-clients">
<h2>Java clients<a class="headerlink" href="#java-clients" title="Permalink to this heading"></a></h2>
<p>Java clients log to <code class="docutils literal notranslate"><span class="pre">$HOME/omero/log</span></code>. The number of files and their
size are limited.</p>
<p><a class="reference external" href="https://github.com/ome/openmicroscopy/blob/develop/etc/logback-cli.xml">logback-cli.xml</a>
controls the output for the command line importer: all logging goes
to standard err, while useful output (pixel ids, or used files) goes to
standard out. It is contained within the <code class="docutils literal notranslate"><span class="pre">omero-blitz.jar</span></code> itself. Therefore, to
modify the settings use <cite>-Dlogback.configurationFile=/path/to/logback.xml</cite> or
similar.</p>
<p>OMERO.insight logging is configured via <cite>logback.xml</cite>
which is available in the config/ directory of any OMERO.insight install.</p>
</section>
<section id="java-servers">
<h2>Java servers<a class="headerlink" href="#java-servers" title="Permalink to this heading"></a></h2>
<p>Java server components are configured by passing
<code class="docutils literal notranslate"><span class="pre">-Dlogback.configurationFile=etc/logback.xml</span></code> to each Java process.
<a class="reference external" href="https://github.com/ome/openmicroscopy/blob/develop/etc/logback.xml">logback.xml</a> includes the <code class="docutils literal notranslate"><span class="pre">scan</span></code> attribute so
that changes to the logging configuration are <a class="reference external" href="https://logback.qos.ch/manual/configuration.html#autoScan">automatically reloaded at
regular intervals</a>.</p>
<p>By default, the output from logback is sent to a file named <code class="file docutils literal notranslate"><span class="pre">&lt;servername&gt;.log</span></code>
under the directory specified by <code class="xref std std-property docutils literal notranslate"><span class="pre">omero.logging.directory</span></code>, by
default <code class="file docutils literal notranslate"><span class="pre">var/log</span></code>.
Once files reach a size specified by <code class="xref std std-property docutils literal notranslate"><span class="pre">omero.logging.logsize</span></code>, 500MB
by default, they are rolled over to <code class="file docutils literal notranslate"><span class="pre">&lt;servername&gt;.log.1</span></code>,
<code class="file docutils literal notranslate"><span class="pre">&lt;servername&gt;.log.2</span></code>, etc. The maximum of rotated log files is specified
by <code class="xref std std-property docutils literal notranslate"><span class="pre">omero.logging.lognum</span></code>.
Once the files have rolled over, you can safely delete or compress (bzip2,
gzip, zip) them. Alternatively, once you are comfortable with the
stability of your server, you can either reduce logging or the number
and size of the files kept. <strong>Note:</strong> if something goes wrong with your
server installation, the log files can be very useful in tracking down
issues.</p>
<p>In addition, each import process logs to a file under the managed
repository which matches the timestamped fileset directory’s name.
For example, if an imported fileset is uploaded to
<code class="file docutils literal notranslate"><span class="pre">/OMERO/ManagedRepository/userA_1/2013-06/17/12-00-00.000</span></code>, then
the log file can be found under
<code class="file docutils literal notranslate"><span class="pre">/OMERO/ManagedRepository/userA_1/2013-06/17/12-00-00.000.log</span></code>.</p>
</section>
<section id="python-servers">
<h2>Python servers<a class="headerlink" href="#python-servers" title="Permalink to this heading"></a></h2>
<p>Python servers are configured by a call to
<code class="docutils literal notranslate"><span class="pre">omero.util.configure_server_logging(props)</span></code>. The property values are
taken from the configuration file passed to the server via icegridnode.
For example, the config file for Processor-0 can be found in
<code class="docutils literal notranslate"><span class="pre">var/master/servers/Processor-0/config/config</span></code>. These values come from
<code class="file docutils literal notranslate"><span class="pre">etc/grid/templates.xml</span></code>.</p>
<p>Similar to the Java servers, logging is configured to be written to
<code class="file docutils literal notranslate"><span class="pre">var/log/&lt;servername&gt;.log</span></code> and to maintain 9 backups of at most 500MB
by default. All the <code class="docutils literal notranslate"><span class="pre">omero.logging</span></code> properties can be specified via configuration -
see <a class="reference internal" href="../sysadmins/config.html#log-configuration"><span class="std std-ref">Logging</span></a> for more details</p>
</section>
<section id="stdout-and-stderr">
<h2>stdout and stderr<a class="headerlink" href="#stdout-and-stderr" title="Permalink to this heading"></a></h2>
<p>Though all components try to avoid it, some output will still go to
stdout/stderr. On non-Windows systems, all of this output will be sent
to the <code class="file docutils literal notranslate"><span class="pre">var/log/master.out</span></code> and <code class="file docutils literal notranslate"><span class="pre">var/log/master.err</span></code> files.</p>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="Modules/ExceptionHandling.html" class="btn btn-neutral float-left" title="Exception handling" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="Server/GraphRequests.html" class="btn btn-neutral float-right" title="Graph requests" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2000-2025, The Open Microscopy Environment.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>