Package liquibase.logging

Examples of liquibase.logging.Logger


                String countSql =
                        "select count(*) from HTextFlow where wordCount is null or wordCount = 0";
                ResultSet rs2 = stmt.executeQuery(countSql);
                rs2.next();
                long totalRows = rs2.getLong(1);
                Logger log = LogFactory.getLogger();
                log.info("CountWordsInHTextFlow: updating " + totalRows
                        + " rows");
                String textFlowSql =
                        "select id, document_id, content, wordCount from HTextFlow where wordCount is null or wordCount = 0";
                ResultSet rs3 = stmt.executeQuery(textFlowSql);
                long rowsUpdated = 0;
                while (rs3.next()) {
                    // primary key only needed for updatable ResultSet
                    rs3.getLong(1);
                    long docId = rs3.getLong(2);
                    String content = rs3.getString(3);
                    String locale = docToLocaleMap.get(docId);
                    long wordCount = OkapiUtil.countWords(content, locale);
                    rs3.updateLong(4, wordCount);
                    rs3.updateRow();
                    if (++rowsUpdated % 10000 == 0) {
                        log.info("CountWordsInHTextFlow: updated "
                                + rowsUpdated + "/" + totalRows);
                    }
                }
                log.info("CountWordsInHTextFlow: finished");
            } finally {
                stmt.close();
            }
        } catch (SQLException e) {
            throw new CustomChangeException(e);
View Full Code Here


        protected void redirectLogger() {
            registerHandler(createHandler());
        }

        protected void registerHandler(Handler theHandler) {
            Logger logger = LogFactory.getInstance().getLog();
        }
View Full Code Here

        this.changeSetFilters = Arrays.asList(changeSetFilters);
    }

    public void run(ChangeSetVisitor visitor, RuntimeEnvironment env) throws LiquibaseException {
      Logger log = LogFactory.getLogger();
      databaseChangeLog.setRuntimeEnvironment(env);
      log.setChangeLog(databaseChangeLog);
        try {
            List<ChangeSet> changeSetList = new ArrayList<ChangeSet>(databaseChangeLog.getChangeSets());
            if (visitor.getDirection().equals(ChangeSetVisitor.Direction.REVERSE)) {
                Collections.reverse(changeSetList);
            }

            for (ChangeSet changeSet : changeSetList) {
                boolean shouldVisit = true;
                Set<ChangeSetFilterResult> reasonsAccepted = new HashSet<ChangeSetFilterResult>();
                Set<ChangeSetFilterResult> reasonsDenied = new HashSet<ChangeSetFilterResult>();
                if (changeSetFilters != null) {
                    for (ChangeSetFilter filter : changeSetFilters) {
                        ChangeSetFilterResult acceptsResult = filter.accepts(changeSet);
                        if (acceptsResult.isAccepted()) {
                            reasonsAccepted.add(acceptsResult);
                        } else {
                            shouldVisit = false;
                            reasonsDenied.add(acceptsResult);
                            break;
                        }
                    }
                }

                log.setChangeSet(changeSet);
                if (shouldVisit) {
                    visitor.visit(changeSet, databaseChangeLog, env.getTargetDatabase(), reasonsAccepted);
                } else {
                    if (visitor instanceof SkippedChangeSetVisitor) {
                        ((SkippedChangeSetVisitor) visitor).skipped(changeSet, databaseChangeLog, env.getTargetDatabase(), reasonsDenied);
                    }
                }
                log.setChangeSet(null);
            }
        } finally {
            log.setChangeLog(null);
            databaseChangeLog.setRuntimeEnvironment(null);
        }
    }
View Full Code Here

            throw new LiquibaseException("Unexpected error running Liquibase: " + message, e);
        }
    }

    private static String generateLogLevelWarningMessage() {
        Logger logger = LogFactory.getInstance().getLog();
        if (logger != null && logger.getLogLevel() != null && (logger.getLogLevel().equals(LogLevel.OFF))) {
            return "";
        } else {
            return "\n\nFor more information, use the --logLevel flag";
        }
    }
View Full Code Here

            return statements.toArray(new SqlStatement[statements.size()]);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (UnexpectedLiquibaseException ule) {
                if (getChangeSet() != null && getChangeSet().getFailOnError() != null && !getChangeSet().getFailOnError()) {
                    Logger log = LogFactory.getLogger();
                    log.info("Change set " + getChangeSet().toString(false) + " failed, but failOnError was false.  Error: " + ule.getMessage());       
                    return new SqlStatement[0];
                } else {
                    throw ule;
                }
        } finally {
View Full Code Here

            pathName = pathName.replace('\\', '/');

            if (!(pathName.endsWith("/"))) {
                pathName = pathName + '/';
            }
            Logger log = LogFactory.getInstance().getLog();
            log.debug("includeAll for " + pathName);
            log.debug("Using file opener for includeAll: " + resourceAccessor.toString());

            String relativeTo = null;
            if (isRelativeToChangelogFile) {
                relativeTo = this.getPhysicalFilePath();
            }
View Full Code Here

TOP

Related Classes of liquibase.logging.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.