def createLogAppender(name, file):
    lc = LoggerFactory.getILoggerFactory()
    ple = PatternLayoutEncoder()
    ple.setPattern('%date %level [%thread] %logger{10} [%file:%line] %msg%n')
    ple.setContext(lc)
    ple.start()
    fileAppender = FileAppender()
    fileAppender.setFile(file)
    fileAppender.setEncoder(ple)
    fileAppender.setContext(lc)
    fileAppender.start()
    logger = LoggerFactory.getLogger(string)
    logger.addAppender(fileAppender)
    logger.setAdditive(True)
    return logger
def createLogAppender(name, file):
    lc = LoggerFactory.getILoggerFactory()
    ple = PatternLayoutEncoder()
    ple.setPattern('%date %level [%thread] %logger{10} [%file:%line] %msg%n')
    ple.setContext(lc)
    ple.start()
    fileAppender = FileAppender()
    fileAppender.setFile(file)
    fileAppender.setEncoder(ple)
    fileAppender.setContext(lc)
    fileAppender.start()
    logger = LoggerFactory.getLogger(string)
    logger.addAppender(fileAppender)
    logger.setAdditive(True)
    return logger