<spanid="evennia-contrib-utils-auditing-outputs"></span><h1>evennia.contrib.utils.auditing.outputs<aclass="headerlink"href="#module-evennia.contrib.utils.auditing.outputs"title="Permalink to this headline">¶</a></h1>
<p>Auditable Server Sessions - Example Outputs
Example methods demonstrating output destinations for logs generated by
audited server sessions.</p>
<p>This is designed to be a single source of events for developers to customize
and add any additional enhancements before events are written out– i.e. if you
want to keep a running list of what IPs a user logs in from on account/character
objects, or if you want to perform geoip or ASN lookups on IPs before committing,
or tag certain events with the results of a reputational lookup, this should be
the easiest place to do it. Write a method and invoke it via
<strong>settings.AUDIT_CALLBACK</strong> to have log data objects passed to it.</p>
<codeclass="sig-prename descclassname">evennia.contrib.utils.auditing.outputs.</code><codeclass="sig-name descname">to_file</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/utils/auditing/outputs.html#to_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.utils.auditing.outputs.to_file"title="Permalink to this definition">¶</a></dt>
<dd><p>Writes dictionaries of data generated by an AuditedServerSession to files
in JSON format, bucketed by date.</p>
<p>Uses Evennia’s native logger and writes to the default
log directory (~/yourgame/server/logs/ or settings.LOG_DIR)</p>
<codeclass="sig-prename descclassname">evennia.contrib.utils.auditing.outputs.</code><codeclass="sig-name descname">to_syslog</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/utils/auditing/outputs.html#to_syslog"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.utils.auditing.outputs.to_syslog"title="Permalink to this definition">¶</a></dt>
<dd><p>Writes dictionaries of data generated by an AuditedServerSession to syslog.</p>
<p>Takes advantage of your system’s native logger and writes to wherever
you have it configured, which is independent of Evennia.
Linux systems tend to write to /var/log/syslog.</p>
<p>If you’re running rsyslog, you can configure it to dump and/or forward logs
to disk and/or an external data warehouse (recommended– if your server is
compromised or taken down, losing your logs along with it is no help!).</p>