Add a default logging configuration file, and small typo fixes

This commit is contained in:
Guillaume Ayoub 2011-05-07 12:52:54 +02:00
parent e87ffeadb1
commit 899379d073
3 changed files with 71 additions and 5 deletions

7
config
View File

@ -1,3 +1,6 @@
# -*- mode: conf -*-
# vim:ft=cfg
# Config file for Radicale - A simple calendar server
#
# Place it into /etc/radicale/config (global)
@ -5,6 +8,7 @@
#
# The current values are the default ones
[server]
# CalDAV server hostnames separated by a comma
# IPv4 syntax: address:port
@ -31,6 +35,7 @@ stock = utf-8
# Value: None | htpasswd | LDAP
type = None
# Personal calendars only available for logged in users
# If True, /alice/calendar will only be available for alice
personal = False
# Htpasswd filename
htpasswd_filename = /etc/radicale/users
@ -56,5 +61,3 @@ folder = ~/.config/radicale/calendars
config = /etc/radicale/logging
# Set the default logging level to debug
debug = False
# vim:ft=cfg

63
logging Normal file
View File

@ -0,0 +1,63 @@
# -*- mode: conf -*-
# vim:ft=cfg
# Logging config file for Radicale - A simple calendar server
#
# The default path for this file is /etc/radicale/logging
# This can be changed in the configuration file
#
# Other handlers are available. For more information, see:
# http://docs.python.org/library/logging.config.html
# Loggers, handlers and formatters keys
[loggers]
# Loggers names, main configuration slots
keys=root
[handlers]
# Logging handlers, defining logging output methods
keys=console,file
[formatters]
# Logging formatters
keys=simple,full
# Loggers
[logger_root]
# Root logger
level=DEBUG
handlers=console,file
# Handlers
[handler_console]
# Console handler
class=StreamHandler
level=INFO
args=(sys.stdout,)
formatter=simple
[handler_file]
# File handler
class=FileHandler
level=DEBUG
args=('/var/log/radicale',)
formatter=full
# Formatter
[formatter_simple]
# Simple output format
format=%(message)s
datefmt=
[formatter_full]
# Full output format
format=%(asctime)s - %(levelname)s: %(message)s
datefmt=

View File

@ -32,7 +32,7 @@ import logging.config
from radicale import config
LOGGER = logging.getLogger("radicale")
LOGGER = logging.getLogger()
FILENAME = os.path.expanduser(config.get("logging", "config"))
def start(debug=False):
@ -46,5 +46,5 @@ def start(debug=False):
else:
# Default configuration, standard output
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
handler.setFormatter(logging.Formatter("%(message)s"))
LOGGER.addHandler(handler)