
############################################################
#
# generic Rattail config
#
############################################################


##############################
# rattail
##############################

[rattail]
timezone.default = America/Chicago
# TODO: you probably should change these to absolute path
datadir = app/data
batch.files = app/batch
workdir = app/work

[rattail.config]
# include = /etc/rattail/rattail.conf
configure_logging = true
usedb = true
preferdb = true

[rattail.db]
default.url = postgresql://rattail:rattailpass@localhost/rattail
# TODO: enable if you want data versioning
# versioning.enabled = true

[rattail.mail]
send_emails = false
smtp.server = localhost
templates = rattail:templates/mail
default.prefix = [Rattail]
default.from = rattail@localhost
default.to = root@localhost
# default.enabled = false


##############################
# alembic
##############################

[alembic]
# TODO: must set these for your app if you extend the DB schema
# script_location = poser.db:alembic
# version_locations = poser.db:alembic/versions rattail.db:alembic/versions
script_location = rattail.db:alembic
version_locations = rattail.db:alembic/versions


##############################
# logging
##############################

[loggers]
keys = root, exc_logger, beaker, txn, sqlalchemy, django_db, flufl_bounce, requests

[handlers]
keys = file, console, email

[formatters]
keys = generic, console

[logger_root]
handlers = file, console
level = DEBUG

[logger_exc_logger]
qualname = exc_logger
handlers = email
level = ERROR

[logger_beaker]
qualname = beaker
handlers =
level = INFO

[logger_txn]
qualname = txn
handlers =
level = INFO

[logger_sqlalchemy]
qualname = sqlalchemy.engine
handlers =
# handlers = file
# level = INFO

[logger_django_db]
qualname = django.db.backends
handlers =
level = INFO
# level = DEBUG

[logger_flufl_bounce]
qualname = flufl.bounce
handlers =
level = WARNING

[logger_requests]
qualname = requests
handlers =
# level = WARNING

[handler_file]
class = handlers.RotatingFileHandler
# TODO: you probably should change this to absolute path
args = ('app/log/rattail.log', 'a', 1000000, 100, 'utf_8')
formatter = generic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
formatter = console
# formatter = generic
# level = INFO
# level = WARNING

[handler_email]
class = handlers.SMTPHandler
args = ('localhost', 'rattail@localhost', ['root@localhost'], "[Rattail] Logging")
formatter = generic
level = ERROR

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(funcName)s: %(message)s
datefmt = %Y-%m-%d %H:%M:%S

[formatter_console]
format = %(levelname)-5.5s [%(name)s][%(threadName)s] %(funcName)s: %(message)s
