Configuration
CUE Zipline is
delivered with a default logging configuration which you will find in
the logging
section of the configuration file
(/etc/cue/zipline/zipline.yaml
):
logging: version: 1 formatters: precise: format: '%(asctime)s - %(levelname)-5s - %(name)s - %(message)s' style: '%' handlers: file: class: logging.handlers.TimedRotatingFileHandler formatter: precise filename: /var/log/zipline/zipline.log when: midnight level: DEBUG encoding: UTF-8 root: level: DEBUG handlers: - file loggers: {}
This simple configuration writes all messages to
the file /var/log/zipline/zipline.log
. The file is
overwritten at midnight each day.
In the installation contrib
folder
(/usr/share/cue/cue-zipline/contrib/
), you will find
a more sophisticated logging configuration in a file called
logging-config.yaml
:
version: 1 formatters: precise: format: '%(asctime)s - %(levelname)-5s - %(name)s - %(message)s' style: '%' handlers: debugfile: class: logging.handlers.TimedRotatingFileHandler formatter: precise filename: /var/log/zipline/zipline.debug.log backupCount: 7 when: midnight level: DEBUG encoding: UTF-8 file: class: logging.handlers.TimedRotatingFileHandler formatter: precise filename: /var/log/zipline/zipline.log backupCount: 7 when: midnight level: ERROR encoding: UTF-8 # Root logger configuration root: level: DEBUG handlers: - debugfile - file loggers: chardet.charsetprober: level: ERROR cue.zipline.text.transform_text.TextTransformer: level: INFO cue.concurrent.actor.Actor: level: INFO cue.zipline.audit: level: CRITICAL
This configuration only writes ERROR
messages to
/var/log/zipline/zipline.log
, but in addition writes
all messages to /var/log/zipline/zipline.debug.log
.
In addition, the backupCount
settings of
7
means that 7 backup copies of each log file are
retained, so that you always have all messages from the preceding week
available.
On startup, CUE Zipline looks in two places for a logging configuration:
-
First, it looks for a standalone logging configuration in
/etc/cue/zipline/logging-config.yaml
. If it finds a configuration here, then that is the one it uses. -
If
/etc/cue/zipline/logging-config.yaml
does not exist, then it looks for alogging
section in/etc/cue/zipline/zipline.yaml
and uses the configuration it finds there. -
If it cannot find a logging configuration in either place, then CUE Zipline uses its internal defaults, which provide minimal functionality.
You can therefore choose where to keep your logging configuration.
Either edit the default configuration in
/etc/cue/zipline/zipline.yaml
to meet your
requirements, or copy
/usr/share/cue/cue-zipline/contrib/logging-config.yaml
into the /etc/cue/zipline/
folder and edit that
instead. If you decide to use a standalone
logging-config.yaml
file, then it is a good idea to
remove the logging section from
/etc/cue/zipline/zipline.yaml
to avoid confusion.
For detailed information about the logging configuration format, see here.