docs: function knexAppender(config, layouts) {
  
    if (! config.knex) {
      throw new Error('knex.js connection parameters are missing');
    }
  
    let layout = null;
    if (config.layout) {
      layout = layouts.layout(config.layout.type, config.layout);
    } else {
      layout = layouts.messagePassThroughLayout;
    }
  
    let tableName = config.table || 'log';
    let additionalFields = config.additionalFields || {};
    let knex = typeof config.knex === 'object' ? Knex(config.knex) : config.knex;
  
    function writeEvent(loggingEvent) {
  
      // Build a record to insert
      const record = Object.assign({}, {
        time: loggingEvent.startTime.valueOf(),
        data: layout(loggingEvent),
        rank: loggingEvent.level.level,
        level: loggingEvent.level.levelStr,
        category: loggingEvent.categoryName
      }, additionalFields);
  
      // Insert it, inside a transaction
      return knex.transaction((trx) => trx(tableName).insert(record).then(() => null));
    };
  
    return writeEvent;
  }