APISonar


liquibase.logging.LogType.LOG

> liquibase > logging > LogType > LOG
liquibase APIs logging APIs LogType APIs LOG APIs

Example 1
private void runOnAllDataSources() throws LiquibaseException {
		Logger log = Scope.getCurrentScope().getLog(getClass());

		for(DataSource aDataSource : dataSources) {
            log.info(LogType.LOG, "Initializing Liquibase for data source " + aDataSource);
            SpringLiquibase liquibase = getSpringLiquibase(aDataSource);
			liquibase.afterPropertiesSet();
            log.info(LogType.LOG, "Liquibase ran for data source " + aDataSource);
        }
	}
Example 2
protected void findInAllClasses(PackageScanFilter test, String packageName, Set<Class<?>> classes) {
        log.fine(LogType.LOG, "Searching for: " + test + " in package: " + packageName );

        Set<Class> packageClasses = getFoundClasses(packageName);
        if (packageClasses == null) {
            log.fine(LogType.LOG, "No classes found in package: " + packageName );
            return;
        }
        for (Class type : packageClasses) {
            if (test.matches(type)) {
                classes.add(type);
            }
        }

    }
Example 3
private void runOnAllSchemas() throws LiquibaseException {
		Logger log = Scope.getCurrentScope().getLog(getClass());

		for(String schema : schemas) {
			if("default".equals(schema)) {
				schema = null;
			}
            log.info(LogType.LOG, "Initializing Liquibase for schema " + schema);
            SpringLiquibase liquibase = getSpringLiquibase(dataSource);
			liquibase.setDefaultSchema(schema);
			liquibase.afterPropertiesSet();
            log.info(LogType.LOG, "Liquibase ran for schema " + schema);
        }
	}
Example 4
public Set<Class<?>> findByFilter(PackageScanFilter filter, String... packageNames) {
        if (packageNames == null) {
            return Collections.EMPTY_SET;
        }

        Set<Class<?>> classes = new LinkedHashSet<Class<?>>();
        for (String pkg : packageNames) {
            find(filter, pkg, classes);
        }

        log.fine(LogType.LOG, "Found: " + classes);

        return classes;
    }
Example 5
protected void executePreparedStatement(PreparedStatement stmt) throws SQLException {
        int updateCounts[] = stmt.executeBatch();
        long sumUpdateCounts = 0;
        for (int updateCount : updateCounts) {
            sumUpdateCounts = updateCount;
        }
        LOG.info(LogType.LOG, String.format("Executing JDBC DML batch was successful. %d operations were executed, %d individual UPDATE events were confirmed by the database.",
                updateCounts.length, sumUpdateCounts));
    }
Example 6
public Set<ClassLoader> getClassLoaders() {
        if (classLoaders == null) {
            classLoaders = new HashSet<ClassLoader>();
            ClassLoader ccl = Thread.currentThread().getContextClassLoader();
            if (ccl != null) {
                log.fine(LogType.LOG, "The thread context class loader: " + ccl + "  is used to load the class");
                classLoaders.add(ccl);
            }
            classLoaders.add(DefaultPackageScanClassResolver.class.getClassLoader());
        }
        return classLoaders;
    }
Example 7
protected void attachParams(List<ColumnConfig> cols, PreparedStatement stmt)
            throws SQLException, DatabaseException {
        int i = 1;  // index starts from 1
        for (ColumnConfig col : cols) {
            LOG.fine(LogType.LOG, "Applying column parameter = " + i + " for column " + col.getName());
            applyColumnParameter(stmt, i, col);
            i++;
        }
    }
Example 8
protected Enumeration<URL> getResources(ClassLoader loader, String packageName) throws IOException {
        log.fine(LogType.LOG, "Getting resource URL for package: " + packageName + " with classloader: " + loader);

        // If the URL is a jar, the URLClassloader.getResources() seems to require a trailing slash.  The
        // trailing slash is harmless for other URLs
        if (!packageName.endsWith("/")) {
            packageName = packageName + "/";
        }
        return loader.getResources(packageName);
    }
Example 9
private final void tryProxySession(final String url, final Connection con) {
        Matcher m = PROXY_USER.matcher(url);
        if (m.matches()) {
            Properties props = new Properties();
            props.put("PROXY_USER_NAME", m.group(1));
            try {
                Method method = con.getClass().getMethod("openProxySession", int.class, Properties.class);
                method.setAccessible(true);
                method.invoke(con, 1, props);
            } catch (Exception e) {
                Scope.getCurrentScope().getLog(getClass()).info(LogType.LOG, "Could not open proxy session on OracleDatabase: " + e.getCause().getMessage());
            }
        }
    }
Example 10
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
        Scope.getCurrentScope().getLog(getClass()).warning(LogType.LOG, "Current XML parsers seems to not support EntityResolver2. External entities won't be correctly loaded");
        return resolveEntity(null, publicId, null, systemId);
    }
Example 11
public void attached(Database database) {
        try {
            database.addReservedWords(Arrays.asList(this.getWrappedConnection().getMetaData().getSQLKeywords().toUpperCase().split(",\\s*")));
        } catch (SQLException e) {
            Scope.getCurrentScope().getLog(getClass()).info(LogType.LOG, "Error fetching reserved words list from JDBC driver", e);
        }


    }
Example 12
protected void updateListeners(String message) {
        if (this.statusListeners == null) {
            return;
        }
        Scope.getCurrentScope().getLog(getClass()).fine(LogType.LOG, message);
        for (DiffStatusListener listener : this.statusListeners) {
            listener.statusUpdate(message);
        }
    }
Example 13
public void tag(String tagString) throws DatabaseException {
        Scope.getCurrentScope().getLog(getClass()).info(LogType.LOG, "Custom tagging");
        super.tag(tagString);
    }
Example 14
protected Enumeration<URL> getResources(ClassLoader loader, String packageName) throws IOException {
        // try super first, just in vase
        Enumeration<URL> enumeration = super.getResources(loader, packageName);
        if (!enumeration.hasMoreElements()) {
            log.fine(LogType.LOG, "Using WebSphere workaround to load the camel jars with the annotated converters.");
            // Special WebSphere trick to load a file that exists in the JAR and then let it go from there.
            // The trick is that we just need the URL's for the .jars that contains the type
            // converters that is annotated. So by searching for this resource WebSphere is able to find
            // it and return the URL to the .jar file with the resource. Then the DefaultPackageScanClassResolver
            // can take it from there and find the classes that are annotated.
            enumeration = loader.getResources(resourcePath);
        }

        return enumeration;
    }
Example 15
protected String getConnectionSchemaName() {
        if ((getConnection() == null) || (getConnection() instanceof OfflineConnection)) {
            return null;
        }
        try {
            String schemaName = ExecutorService.getInstance().getExecutor(this).queryForObject(new RawSqlStatement("select username from sysmaster:informix.syssessions where sid = dbinfo('sessionid')"), String.class);
            if (schemaName != null) {
                return schemaName.trim();
            }
        } catch (Exception e) {
            Scope.getCurrentScope().getLog(getClass()).info(LogType.LOG, "Error getting connection schema", e);
        }
        return null;
    }
Example 16
public NamespaceDetails getNamespaceDetails(LiquibaseSerializer serializer, String namespace) {
        SortedSet<NamespaceDetails> validNamespaceDetails = new TreeSet<>(new SerializerNamespaceDetailsComparator());

        for (NamespaceDetails details : namespaceDetails) {
            if (details.supports(serializer, namespace)) {
                validNamespaceDetails.add(details);
            }
        }

        if (validNamespaceDetails.isEmpty()) {
            Scope.getCurrentScope().getLog(getClass()).fine(LogType.LOG, "No serializer namespace details associated with namespace '" + namespace + "' and serializer " + serializer.getClass().getName());
        }

        return validNamespaceDetails.iterator().next();
    }
Example 17
public void check(Database database) throws CustomPreconditionFailedException {
        Scope.getCurrentScope().getLog(getClass()).info(LogType.LOG, "Custom precondition ran. Name: "+name+", count: "+count  );

//        throw new CustomPreconditionFailedException("custom precondition failed", new RuntimeException());
    }