Skip to content

Commit

Permalink
Add a default logging configuration file, and small typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed May 7, 2011
1 parent e87ffea commit 899379d
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 5 deletions.
9 changes: 6 additions & 3 deletions config
@@ -1,10 +1,14 @@
# -*- mode: conf -*-
# vim:ft=cfg

# Config file for Radicale - A simple calendar server
#
# Place it into /etc/radicale/config (global)
# or ~/.config/radicale/config (user)
#
# The current values are the default ones


[server]
# CalDAV server hostnames separated by a comma
# IPv4 syntax: address:port
Expand All @@ -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
Expand All @@ -55,6 +60,4 @@ folder = ~/.config/radicale/calendars
# http://docs.python.org/library/logging.config.html
config = /etc/radicale/logging
# Set the default logging level to debug
debug = False

# vim:ft=cfg
debug = False
63 changes: 63 additions & 0 deletions logging
@@ -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=
4 changes: 2 additions & 2 deletions radicale/log.py
Expand Up @@ -32,7 +32,7 @@
from radicale import config


LOGGER = logging.getLogger("radicale")
LOGGER = logging.getLogger()
FILENAME = os.path.expanduser(config.get("logging", "config"))

def start(debug=False):
Expand All @@ -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)

0 comments on commit 899379d

Please sign in to comment.