Merge branch 'master' of git://gitorious.org/~clebail/radicale/ares-radicale
This commit is contained in:
commit
8c21c39d30
5
config
5
config
@ -53,7 +53,10 @@ LDAPAppend = ou=users,dc=exmaple,dc=dom
|
|||||||
folder = ~/.config/radicale/calendars
|
folder = ~/.config/radicale/calendars
|
||||||
|
|
||||||
[Logging]
|
[Logging]
|
||||||
# Logging filename
|
# Logging type
|
||||||
|
# Value: syslog | file | stdout
|
||||||
|
type = file
|
||||||
|
# Logging filename (if needed)
|
||||||
logfile = ~/.config/radicale/radicale.log
|
logfile = ~/.config/radicale/radicale.log
|
||||||
# Log facility 10: DEBUG, 20: INFO, 30 WARNING, 40 ERROR, 50 CRITICAL
|
# Log facility 10: DEBUG, 20: INFO, 30 WARNING, 40 ERROR, 50 CRITICAL
|
||||||
facility = 50
|
facility = 50
|
||||||
|
@ -56,7 +56,7 @@ INITIAL_CONFIG = {
|
|||||||
"storage": {
|
"storage": {
|
||||||
"folder": os.path.expanduser("~/.config/radicale/calendars")},
|
"folder": os.path.expanduser("~/.config/radicale/calendars")},
|
||||||
"logging": {
|
"logging": {
|
||||||
"logfile": os.path.expanduser("~/.config/radicale/radicale.log"),
|
"type": "syslog",
|
||||||
"facility": 10},
|
"facility": 10},
|
||||||
"authLdap": {
|
"authLdap": {
|
||||||
"LDAPServer": "127.0.0.1",
|
"LDAPServer": "127.0.0.1",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import logging, sys
|
import logging, sys
|
||||||
|
from logging.handlers import SysLogHandler
|
||||||
from radicale import config
|
from radicale import config
|
||||||
|
|
||||||
class log:
|
class log:
|
||||||
@ -8,8 +9,14 @@ class log:
|
|||||||
self.logger=logging.getLogger("radicale")
|
self.logger=logging.getLogger("radicale")
|
||||||
self.logger.setLevel(config.get("logging", "facility"))
|
self.logger.setLevel(config.get("logging", "facility"))
|
||||||
|
|
||||||
handler=logging.FileHandler(config.get("logging", "logfile"))
|
loggingType=config.get("logging", "type")
|
||||||
|
if loggingType == "stdout":
|
||||||
|
handler=logging.StreamHandler(sys.stdout)
|
||||||
|
elif loggingType == "file":
|
||||||
|
handler=logging.FileHandler(config.get("logging", "logfile"))
|
||||||
|
else:
|
||||||
|
handler=logging.handlers.SysLogHandler("/dev/log")
|
||||||
|
|
||||||
formatter = logging.Formatter('%(name)s %(asctime)s %(levelname)s %(message)s')
|
formatter = logging.Formatter('%(name)s %(asctime)s %(levelname)s %(message)s')
|
||||||
handler.setFormatter(formatter)
|
handler.setFormatter(formatter)
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ def propfind(path, xml_request, calendar, depth):
|
|||||||
"""Read and answer PROPFIND requests.
|
"""Read and answer PROPFIND requests.
|
||||||
|
|
||||||
Read rfc4918-9.1 for info.
|
Read rfc4918-9.1 for info.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Reading request
|
# Reading request
|
||||||
log.log(10, "Read and answer PROPFIND requests.")
|
log.log(10, "Read and answer PROPFIND requests.")
|
||||||
|
Loading…
Reference in New Issue
Block a user