Examples of LogContext


Examples of javolution.context.LogContext

     * context is not a {@link StandardLog} no message is logged.
     *
     * @param msg the finer message.
     */
    public static void finer(String msg) {
        LogContext log = (LogContext) LogContext.getCurrentLogContext();
        if (log instanceof StandardLog) {
            ((StandardLog) log)._logger.finer(msg);
        }
    }
View Full Code Here

Examples of javolution.context.LogContext

     * context is not a {@link StandardLog} no message is logged.
     *
     * @param msg the finest message.
     */
    public static void finest(String msg) {
        LogContext log = (LogContext) LogContext.getCurrentLogContext();
        if (log instanceof StandardLog) {
            ((StandardLog) log)._logger.finest(msg);
        }
    }
View Full Code Here

Examples of javolution.context.LogContext

     * @param sourceMethod name of the method.
     * @param thrown the error that is being thrown.
     */
    public static void throwing(String sourceClass, String sourceMethod,
            Throwable thrown) {
        LogContext log = (LogContext) LogContext.getCurrentLogContext();
        if (log instanceof StandardLog) {
            ((StandardLog) log)._logger.throwing(sourceClass, sourceMethod,
                    thrown);
        } else {
            LogContext.error(thrown, "Thrown by " + sourceClass + "." + sourceMethod);
View Full Code Here

Examples of javolution.context.LogContext

     *
     * @param sourceClass name of class that issued the logging request.
     * @param sourceMethod name of method that is being entered.
     */
    public static void entering(String sourceClass, String sourceMethod) {
        LogContext log = (LogContext) LogContext.getCurrentLogContext();
        if (log instanceof StandardLog) {
            ((StandardLog) log)._logger.entering(sourceClass, sourceMethod);
        } else {
             LogContext.debug("Entering " + sourceClass + "." + sourceMethod);
        }
View Full Code Here

Examples of javolution.context.LogContext

     *
     * @param sourceClass name of class that issued the logging request.
     * @param sourceMethod name of method that is being returned.
     */
    public static void exiting(String sourceClass, String sourceMethod) {
        LogContext log = (LogContext) LogContext.getCurrentLogContext();
        if (log instanceof StandardLog) {
            ((StandardLog) log)._logger.exiting(sourceClass, sourceMethod);
        } else {
             LogContext.debug("Exiting " + sourceClass + "." + sourceMethod);
        }
View Full Code Here

Examples of org.grouplens.lenskit.util.LogContext

    @SuppressWarnings("PMD.AvoidCatchingThrowable")
    public T perform() throws TaskExecutionException {
        Preconditions.checkState(algorithm != null, "no algorithm specified");
        Preconditions.checkState(inputData != null, "no input data specified");
        Preconditions.checkState(action != null, "no action specified");
        LogContext context = new LogContext();
        try {
            context.put("lenskit.eval.command.class", getName());
            context.put("lenskit.eval.command.name", getName());
            context.put("lenskit.eval.algorithm.name", algorithm.getName());

            // TODO Support serializing the recommender
            LenskitRecommender rec;
            StopWatch timer = new StopWatch();
            timer.start();
            try {
                logger.info("{}: building recommender {}", getName(), algorithm.getName());
                LenskitConfiguration config = new LenskitConfiguration();
                inputData.configure(config);
                rec = algorithm.buildRecommender(config);
            } catch (RecommenderBuildException e) {
                throw new TaskExecutionException(getName() + ": error building recommender", e);
            }
            timer.stop();
            logger.info("{}: trained in {}", getName(), timer);
            return action.apply(rec);
        } finally {
            context.finish();
        }
    }
View Full Code Here

Examples of org.jboss.logmanager.LogContext

            final PathAddress address = getAddress(operation);
            final String name = getAddressName(operation);
            final ConfigurationPersistence configurationPersistence;
            final boolean isLoggingProfile = LoggingProfileOperations.isLoggingProfileAddress(address);
            if (isLoggingProfile) {
                final LogContext logContext = LoggingProfileContextSelector.getInstance().getOrCreate(LoggingProfileOperations.getLoggingProfileName(address));
                configurationPersistence = ConfigurationPersistence.getOrCreateConfigurationPersistence(logContext);
            } else {
                configurationPersistence = ConfigurationPersistence.getOrCreateConfigurationPersistence();
            }
            final LogContextConfiguration logContextConfiguration = configurationPersistence.getLogContextConfiguration();
View Full Code Here

Examples of org.jboss.logmanager.LogContext

            final String name = getAddressName(operation);
            final PathAddress address = getAddress(operation);
            final ConfigurationPersistence configurationPersistence;
            final boolean isLoggingProfile = LoggingProfileOperations.isLoggingProfileAddress(address);
            if (isLoggingProfile) {
                final LogContext logContext = LoggingProfileContextSelector.getInstance().getOrCreate(LoggingProfileOperations.getLoggingProfileName(address));
                configurationPersistence = ConfigurationPersistence.getOrCreateConfigurationPersistence(logContext);
            } else {
                configurationPersistence = ConfigurationPersistence.getOrCreateConfigurationPersistence();
            }
            final LogContextConfiguration logContextConfiguration = configurationPersistence.getLogContextConfiguration();
View Full Code Here

Examples of org.jboss.logmanager.LogContext

            final Module module = context.getAttachment(Attachments.MODULE);
            final ClassLoader current = SecurityActions.getThreadContextClassLoader();
            try {
                // Unregister the log context
                SecurityActions.setThreadContextClassLoader(module.getClassLoader());
                final LogContext logContext = LogContext.getLogContext();
                LoggingExtension.CONTEXT_SELECTOR.unregisterLogContext(module.getClassLoader(), logContext);
                LoggingLogger.ROOT_LOGGER.tracef("Removing LogContext '%s' from '%s'", logContext, module);
                context.removeAttachment(LOG_CONTEXT_KEY);
            } finally {
                SecurityActions.setThreadContextClassLoader(current);
View Full Code Here

Examples of org.jboss.logmanager.LogContext

            // Get the profile logging context
            final LoggingProfileContextSelector loggingProfileContext = LoggingProfileContextSelector.getInstance();
            if (loggingProfileContext.exists(loggingProfile)) {
                // Get the module
                final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
                final LogContext logContext = loggingProfileContext.get(loggingProfile);
                LoggingExtension.CONTEXT_SELECTOR.registerLogContext(module.getClassLoader(), logContext);
                LoggingLogger.ROOT_LOGGER.tracef("Registering log context '%s' on '%s' for profile '%s'", logContext, root, loggingProfile);
                // Process sub-deployments
                for (DeploymentUnit subDeployment : subDeployments) {
                    // A sub-deployment must have a module to process
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.