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

Commit 26b4089

Browse files
committed
documentation
1 parent cf2c27a commit 26b4089

File tree

3 files changed

+102
-1
lines changed

3 files changed

+102
-1
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Contents
3737
setup
3838
consumption
3939
api
40+
logging
4041
utilities
4142
guesswork
4243
migrating

docs/logging.rst

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
.. _logging:
2+
3+
Logging
4+
=======
5+
6+
By default paperless logs to standard output and to the database. Logs can be browsed from the paperless web interface in the ``Log`` section.
7+
8+
Sentry
9+
------
10+
11+
Paperless can be configured to send errors to the `sentry.io`_ error tracking software by setting the ``PAPERLESS_SENTRY_DSN`` value in ``paperless.conf``.
12+
13+
.. _sentry.io: https://sentry.io/welcome/
14+
15+
Custom logger
16+
-------------
17+
18+
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
19+
about the format see:
20+
21+
- `Django logging documentation`_
22+
- `Python logging dictConfig documentation`_
23+
24+
.. _Django logging documentation: https://docs.djangoproject.com/en/2.1/topics/logging/
25+
.. _Python logging dictConfig documentation: https://docs.python.org/3/library/logging.config.html#logging-config-dictschema
26+
27+
Examples
28+
--------
29+
30+
Default
31+
+++++++
32+
33+
.. code-block:: yaml
34+
35+
version: 1
36+
disable_existing_loggers: False
37+
handlers:
38+
consumer:
39+
class: documents.loggers.PaperlessLogger
40+
loggers:
41+
documents:
42+
handlers:
43+
- consumer
44+
level: INFO
45+
46+
Send errors by email
47+
++++++++++++++++++++
48+
49+
.. code-block:: yaml
50+
51+
version: 1
52+
disable_existing_loggers: False
53+
handlers:
54+
consumer:
55+
class: documents.loggers.PaperlessLogger
56+
email:
57+
class: logging.handlers.SMTPHandler
58+
mailhost: localhost
59+
60+
toaddrs:
61+
62+
subject: oops!
63+
credentials:
64+
- root
65+
- hunter2
66+
loggers:
67+
documents:
68+
propagate: true
69+
handlers:
70+
- consumer
71+
level: INFO
72+
root:
73+
handlers:
74+
- email
75+
level: ERROR
76+
77+
Log debug to a file
78+
+++++++++++++++++++
79+
80+
.. code-block:: yaml
81+
82+
version: 1
83+
disable_existing_loggers: False
84+
handlers:
85+
consumer:
86+
class: documents.loggers.PaperlessLogger
87+
file:
88+
class: logging.handlers.RotatingFileHandler
89+
filename: paperless.log
90+
maxBytes: 100000000
91+
loggers:
92+
documents:
93+
propagate: true
94+
handlers:
95+
- consumer
96+
level: INFO
97+
root:
98+
handlers:
99+
- file
100+
level: DEBUG

docs/migrating.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ files, the ``migrate`` step may not update anything. This is totally normal.
9292
Additionally, as new features are added, the ability to control those features
9393
is typically added by way of an environment variable set in ``paperless.conf``.
9494
You may want to take a look at the ``paperless.conf.example`` file to see if
95-
there's anything new in there compared to what you've got int ``/etc``.
95+
there's anything new in there compared to what you've got in ``/etc``.
9696

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

0 commit comments

Comments
 (0)