diff --git a/config b/config index 47f0086..34cedb0 100644 --- a/config +++ b/config @@ -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 @@ -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 \ No newline at end of file diff --git a/logging b/logging new file mode 100644 index 0000000..669b35e --- /dev/null +++ b/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= \ No newline at end of file diff --git a/radicale/log.py b/radicale/log.py index 0e027e5..3d36f9f 100644 --- a/radicale/log.py +++ b/radicale/log.py @@ -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)