Configuring Postgres Workload Report
====================================

``pwr`` configuration file
--------------------------

To reduce the number of command-line arguments needed when executing
``pwr`` , you can use a configuration file to specify options that
always have the same value but that value differs from the default.

During execution, ``pwr`` looks for an existing configuration file in
``~/.pwr.conf`` and ``/etc/pwr.conf`` , in that order using the first
one found. However, if the ``--config`` option specifies a configuration
file, that overides the default locations.

The installation package creates a template for the configuration file
in ``/etc/pwr.conf.templ`` . We recommend copying this file to one of
the two places where ``pwr`` looks for a configuration file and editing
the options in the template as necessary.

The following sections describe the options you can configure.

input_dir
^^^^^^^^^

Identifies an existing directory where the ``edb_wait_states`` contents
of a Lasso report are located. This option is used mainly for
``pwr report`` execution (see :ref:`Using Postgres Workload Report <Using Postgres Workload Report>`  ).

output_dir
^^^^^^^^^^

Specifies where reports are outputted. During execution, Postgres
Workload Report tries to create the directory if it doesn’t exist.

report_name
^^^^^^^^^^^

Provides the name of the report files generated. Usually, this option is
specified from the command line because different reports typically have
different names.

log_file
^^^^^^^^

Provides the full path to the file where ``pwr`` writes the ``stdout``
and ``stderr`` logs.

log_level
^^^^^^^^^

Specifies the logging level to use when running Postgres Workload
Report. Valid values are, from more verbose to less verbose:

``DEBUG`` ``INFO`` (default if not specified) ``WARNING`` ``ERROR``
``CRITICAL``

See `the Python logging <https://docs.python.org/3/library/logging.html#logging-levels>`_  documentation for more information about log levels.

log_format
^^^^^^^^^^

Provides the format of the log messages that are written to the log
file. See `the Python logging <https://docs.python.org/3/library/logging.html#logrecord-attributes>`_  documentation for more information on log
formatting.

assets_dir
^^^^^^^^^^

Identifies the directory where you can find the jinja templates used to
format the HTML output and the CSS used for PDF output. Typically, the
directory you may want to use by default is ``/usr/share/pwr/assets`` ,
which contains the assets provided with the ``edb-pwr`` package.
