[annotator-dev] annotator-store log files.

Ewald Zietsman ewald at siyavula.com
Wed Jan 11 12:14:31 UTC 2012


In app.py of the store I've changed the following:

def configure_app():
    '''Configure app loading in order from:

    [annotator.settings_default]
    [annotator.settings_local]
    annotator.cfg # in app root dir
    config file specified by env var ANNOTATOR_CONFIG
    '''
    # app.config.from_object('annotator.settings_default')
    # app.config.from_object('annotator.settings_local')
    here = os.path.dirname(os.path.abspath( __file__ ))
    # parent directory
    config_path = os.path.join(os.path.dirname(here), 'annotator.cfg')
    if os.path.exists(config_path):
        app.config.from_pyfile(config_path)
    if 'ANNOTATOR_CONFIG' in os.environ:
        app.config.from_envvar('ANNOTATOR_CONFIG')
    if not app.debug:
        import logging
        file_handler = logging.FileHandler('/tmp/ann_store_log')
        file_handler.setLevel(logging.INFO)
        app.logger.addHandler(file_handler)


The file /tmp/ann_store_log gets created but nothing gets written to
it if I create annotations. These mods follows the instructions I
found for Flask. Any help will be greatly appreciated.


On Wed, Jan 11, 2012 at 12:52 PM, Ewald Zietsman <ewald at siyavula.com> wrote:
> Hi,
>
> Is there a simple way of making the store write it's logs to a file
> instead of stdout? I need to change my local store to run as a daemon
> and allow configurable log files to be specified at run time.
>
> --
> Ewald Zietsman
>
> Technical Coordinator
>
>
>
> Website: www.siyavula.com
> The Open Innovation Studio, 27 Buitenkant Street, Cape Town, 8001
>
> A Shuttleworth Foundation Seeded Project
> Website: www.shuttleworthfoundation.org



-- 
Ewald Zietsman

Technical Coordinator



Website: www.siyavula.com
The Open Innovation Studio, 27 Buitenkant Street, Cape Town, 8001

A Shuttleworth Foundation Seeded Project
Website: www.shuttleworthfoundation.org




More information about the annotator-dev mailing list