summaryrefslogtreecommitdiff
path: root/docs/integrations/zope.rst
blob: e77a2d64fc2c852011b61ea6031d39dc30cd2dd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Zope/Plone
==========

Installation
------------

If you haven't already, start by downloading Raven. The easiest way is
with *pip*::

	pip install raven --upgrade

zope.conf
---------

Zope has extensible logging configuration options.
A basic instance (not ZEO client) setup for logging looks like this:

.. code-block:: xml

  <eventlog>
    level INFO
    <logfile>
     path ${buildout:directory}/var/{:_buildout_section_name_}.log
     level INFO
    </logfile>

    %import raven.contrib.zope
    <sentry>
      dsn ___DSN___
      level ERROR
    </sentry>
  </eventlog>

This configuration retains normal logging to a logfile, but adds
Sentry logging for ERRORs.

All options of :py:class:`raven.base.Client` are supported.

Use a buildout recipe instead of editing zope.conf directly.
To add the equivalent instance configuration, you would do this:

.. code-block:: ini

    [instance]
    recipe = plone.recipe.zope2instance
    ...
    event-log-custom =
        %import raven.contrib.zope
        <logfile>
          path ${buildout:directory}/var/instance.log
          level INFO
        </logfile>
        <sentry>
          dsn ___DSN___
          level ERROR
        </sentry>

To add the equivalent ZEO client configuration, you would do this:

.. code-block:: ini

    [instance]
    recipe = plone.recipe.zope2instance
    ...
    event-log-custom =
        %import raven.contrib.zope
        <logfile>
          path ${buildout:var-dir}/${:_buildout_section_name_}/event.log
          level INFO
        </logfile>
        <sentry>
          dsn ___DSN___
          level ERROR
        </sentry>