Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ovv committed Jan 31, 2019
1 parent cf2c27a commit 26b4089
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Contents
setup
consumption
api
logging
utilities
guesswork
migrating
Expand Down
100 changes: 100 additions & 0 deletions docs/logging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.. _logging:

Logging
=======

By default paperless logs to standard output and to the database. Logs can be browsed from the paperless web interface in the ``Log`` section.

Sentry
------

Paperless can be configured to send errors to the `sentry.io`_ error tracking software by setting the ``PAPERLESS_SENTRY_DSN`` value in ``paperless.conf``.

.. _sentry.io: https://sentry.io/welcome/

Custom logger
-------------

Paperless support customizing the logging configuration by using a ``/etc/paperless/logging.yml`` file. This file should be in the yaml format and is passed without modification to the python logging ``dictConfig``. For more information
about the format see:

- `Django logging documentation`_
- `Python logging dictConfig documentation`_

.. _Django logging documentation: https://docs.djangoproject.com/en/2.1/topics/logging/
.. _Python logging dictConfig documentation: https://docs.python.org/3/library/logging.config.html#logging-config-dictschema

Examples
--------

Default
+++++++

.. code-block:: yaml
version: 1
disable_existing_loggers: False
handlers:
consumer:
class: documents.loggers.PaperlessLogger
loggers:
documents:
handlers:
- consumer
level: INFO
Send errors by email
++++++++++++++++++++

.. code-block:: yaml
version: 1
disable_existing_loggers: False
handlers:
consumer:
class: documents.loggers.PaperlessLogger
email:
class: logging.handlers.SMTPHandler
mailhost: localhost
fromaddr: [email protected]
toaddrs:
- [email protected]
subject: oops!
credentials:
- root
- hunter2
loggers:
documents:
propagate: true
handlers:
- consumer
level: INFO
root:
handlers:
- email
level: ERROR
Log debug to a file
+++++++++++++++++++

.. code-block:: yaml
version: 1
disable_existing_loggers: False
handlers:
consumer:
class: documents.loggers.PaperlessLogger
file:
class: logging.handlers.RotatingFileHandler
filename: paperless.log
maxBytes: 100000000
loggers:
documents:
propagate: true
handlers:
- consumer
level: INFO
root:
handlers:
- file
level: DEBUG
2 changes: 1 addition & 1 deletion docs/migrating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ files, the ``migrate`` step may not update anything. This is totally normal.
Additionally, as new features are added, the ability to control those features
is typically added by way of an environment variable set in ``paperless.conf``.
You may want to take a look at the ``paperless.conf.example`` file to see if
there's anything new in there compared to what you've got int ``/etc``.
there's anything new in there compared to what you've got in ``/etc``.

If you are :ref:`using Docker <setup-installation-docker>` the update process
is similar:
Expand Down

0 comments on commit 26b4089

Please sign in to comment.