Ensure correct logging initialisation in webgate-cron
This commit is contained in:
parent
fccabc083c
commit
6c114b6dcd
|
@ -19,7 +19,6 @@
|
||||||
# along with gpg-mailgate source code. If not, see <http://www.gnu.org/licenses/>.
|
# along with gpg-mailgate source code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
import GnuPG
|
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
from sqlalchemy.sql import select, delete, and_
|
from sqlalchemy.sql import select, delete, and_
|
||||||
import smtplib
|
import smtplib
|
||||||
|
@ -31,6 +30,13 @@ import logging
|
||||||
import lacre
|
import lacre
|
||||||
import lacre.config as conf
|
import lacre.config as conf
|
||||||
|
|
||||||
|
# Read configuration from /etc/gpg-mailgate.conf
|
||||||
|
conf.load_config()
|
||||||
|
|
||||||
|
lacre.init_logging(conf.get_item('logging', 'config'))
|
||||||
|
LOG = logging.getLogger('webgate-cron.py')
|
||||||
|
|
||||||
|
import GnuPG
|
||||||
|
|
||||||
def _load_file(name):
|
def _load_file(name):
|
||||||
f = open(name)
|
f = open(name)
|
||||||
|
@ -90,13 +96,6 @@ def _define_db_schema():
|
||||||
return (gpgmw_keys)
|
return (gpgmw_keys)
|
||||||
|
|
||||||
|
|
||||||
# Read configuration from /etc/gpg-mailgate.conf
|
|
||||||
conf.load_config()
|
|
||||||
|
|
||||||
lacre.init_logging(conf.get_item('logging', 'config'))
|
|
||||||
LOG = logging.getLogger('webgate-cron.py')
|
|
||||||
|
|
||||||
|
|
||||||
if conf.config_item_equals('database', 'enabled', 'yes') and conf.config_item_set('database', 'url'):
|
if conf.config_item_equals('database', 'enabled', 'yes') and conf.config_item_set('database', 'url'):
|
||||||
(engine, conn) = _setup_db_connection(conf.get_item("database", "url"))
|
(engine, conn) = _setup_db_connection(conf.get_item("database", "url"))
|
||||||
(gpgmw_keys) = _define_db_schema()
|
(gpgmw_keys) = _define_db_schema()
|
||||||
|
|
Loading…
Reference in New Issue