fgcz / bfabricShiny

Manage life sciences data using R and b-fabric - a WSDL/REST interface and a tool box; main focus on MS data
http://fgcz-bfabric.uzh.ch
GNU General Public License v3.0
8 stars 1 forks source link

enable syslog #11

Closed cpanse closed 5 years ago

cpanse commented 5 years ago

https://github.com/cpanse/bfabricShiny/blob/c9ad987b66504e7218ed163b75e70e7095f536ed/exec/bfabric9_flask_sample.py#L19

def create_logger(name="fcc", address=("fgcz-ms.uzh.ch", 514)):
    """
    create a logger object
    """
    syslog_handler = logging.handlers.SysLogHandler(address=address)
    formatter = logging.Formatter('%(name)s %(message)s')
    syslog_handler.setFormatter(formatter)

    logger = logging.getLogger(name)
    logger.setLevel(20)
    logger.addHandler(syslog_handler)

    return logger

logger = create_logger()