syncevolution/test/syncevo-http-server-logging.conf
Patrick Ohly fb82fb3e8e syncevo-http-server: improved logging
Added new command line options:

  -d, --debug           enables debug messages
  -q, --quiet           limits output to real error messages; ignored if
                        --debug is given
  --log-config=LOGCONFIG
                        configure logging via Python logging config file;
                        --debug and --quiet override the log level in the root
                        logger

An example config file is included in the distribution.

The output is now similar to SyncEvolution command line output:
  [DEBUG] twisted: twisted.web.server.Site starting on 9000

The implementation is based on the standard Python logging module.
Twisted output is redirected into it at log levels DEBUG and ERROR.
2010-12-27 17:40:58 +01:00

63 lines
1.4 KiB
Plaintext

# Logging configuration for a syncevo-http-server. Writes log files
# into the current directory, with rotation. Log levels are chosen so
# that important messages (>= INFO) are shown on the console and
# written info syncevo-http-server.log.
#
# The console output is similar to that of the SyncEvolution command
# line whereas the one for files includes a data.
#
# See http://docs.python.org/library/logging.html#configuration-file-format
[loggers]
# root = collects messages from other modules
# twisted = generic HTTP server framework
# syncevo-http = syncevo-http-server output
# sync = normal SyncEvolution output
keys=root,twisted,syncevo_http,sync
[handlers]
keys=consoleHandler,fileHandler
[formatters]
keys=consoleFormatter,fileFormatter
[logger_root]
level=NOTSET
handlers=consoleHandler,fileHandler
[logger_twisted]
level=NOTSET
handlers=
propagate=1
qualname=twisted
[logger_syncevo_http]
level=NOTSET
handlers=
propagate=1
qualname=syncevo-http
[logger_sync]
level=NOTSET
handlers=
propagate=1
qualname=sync
[handler_consoleHandler]
class=StreamHandler
level=INFO
formatter=consoleFormatter
args=(sys.stdout,)
[handler_fileHandler]
class=FileHandler
level=INFO
formatter=fileFormatter
args=('syncevo-http-server.log', 'w')
[formatter_consoleFormatter]
format=[%(levelname)s] %(name)s: %(message)s
[formatter_fileFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s