Add a default logging configuration file, and small typo fixes
This commit is contained in:
parent
e87ffeadb1
commit
899379d073
7
config
7
config
@ -1,3 +1,6 @@
|
|||||||
|
# -*- mode: conf -*-
|
||||||
|
# vim:ft=cfg
|
||||||
|
|
||||||
# Config file for Radicale - A simple calendar server
|
# Config file for Radicale - A simple calendar server
|
||||||
#
|
#
|
||||||
# Place it into /etc/radicale/config (global)
|
# Place it into /etc/radicale/config (global)
|
||||||
@ -5,6 +8,7 @@
|
|||||||
#
|
#
|
||||||
# The current values are the default ones
|
# The current values are the default ones
|
||||||
|
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
# CalDAV server hostnames separated by a comma
|
# CalDAV server hostnames separated by a comma
|
||||||
# IPv4 syntax: address:port
|
# IPv4 syntax: address:port
|
||||||
@ -31,6 +35,7 @@ stock = utf-8
|
|||||||
# Value: None | htpasswd | LDAP
|
# Value: None | htpasswd | LDAP
|
||||||
type = None
|
type = None
|
||||||
# Personal calendars only available for logged in users
|
# Personal calendars only available for logged in users
|
||||||
|
# If True, /alice/calendar will only be available for alice
|
||||||
personal = False
|
personal = False
|
||||||
# Htpasswd filename
|
# Htpasswd filename
|
||||||
htpasswd_filename = /etc/radicale/users
|
htpasswd_filename = /etc/radicale/users
|
||||||
@ -56,5 +61,3 @@ folder = ~/.config/radicale/calendars
|
|||||||
config = /etc/radicale/logging
|
config = /etc/radicale/logging
|
||||||
# Set the default logging level to debug
|
# Set the default logging level to debug
|
||||||
debug = False
|
debug = False
|
||||||
|
|
||||||
# vim:ft=cfg
|
|
||||||
|
63
logging
Normal file
63
logging
Normal 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=
|
@ -32,7 +32,7 @@ import logging.config
|
|||||||
from radicale import config
|
from radicale import config
|
||||||
|
|
||||||
|
|
||||||
LOGGER = logging.getLogger("radicale")
|
LOGGER = logging.getLogger()
|
||||||
FILENAME = os.path.expanduser(config.get("logging", "config"))
|
FILENAME = os.path.expanduser(config.get("logging", "config"))
|
||||||
|
|
||||||
def start(debug=False):
|
def start(debug=False):
|
||||||
@ -46,5 +46,5 @@ def start(debug=False):
|
|||||||
else:
|
else:
|
||||||
# Default configuration, standard output
|
# Default configuration, standard output
|
||||||
handler = logging.StreamHandler(sys.stdout)
|
handler = logging.StreamHandler(sys.stdout)
|
||||||
handler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
|
handler.setFormatter(logging.Formatter("%(message)s"))
|
||||||
LOGGER.addHandler(handler)
|
LOGGER.addHandler(handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user