; notes:
;  - 'args' is mandatory in [handler_*] sections
;  - in lists there must not be spaces

;
; top-level config
;

; list of all loggers
[loggers]
keys=root
; root logger sees everything.  there can be per-job configs by 
; specifing loggers with job_name of the script

; list of all handlers
[handlers]
;; seems logger module immidiately initalized all handlers,
;; whether they are actually used or not.  so better
;; keep this list in sync with actual handler list
;keys=stderr,logdb,logsrv,logfile
keys=stderr

; list of all formatters
[formatters]
keys=short,long,none

;
; map specific loggers to specifig handlers
;
[logger_root]
level=DEBUG
;handlers=stderr,logdb,logsrv,logfile
handlers=stderr

;
; configure formatters
;
[formatter_short]
format=%(asctime)s %(levelname)s %(message)s
datefmt=%H:%M

[formatter_long]
format=%(asctime)s %(process)s %(levelname)s %(message)s

[formatter_none]
format=%(message)s

;
; configure handlers
;

; file.  args: stream
[handler_stderr]
class=StreamHandler
args=(sys.stderr,)
formatter=short

; log into db.  args: conn_string
[handler_logdb]
class=skylog.LogDBHandler
args=("host=127.0.0.1 port=5432 user=logger  dbname=logdb",)
formatter=none
level=INFO

; JSON messages over UDP.  args: host, port
[handler_logsrv]
class=skylog.UdpLogServerHandler
args=('127.0.0.1', 6666)
formatter=none

; rotating logfile.  args: filename, maxsize, maxcount
[handler_logfile]
class=skylog.EasyRotatingFileHandler
args=('~/log/%(job_name)s.log', 100*1024*1024, 3)
formatter=long

