Examples of Log


Examples of org.apache.commons.logging.Log

            formatter.setLenient(false);

            date = formatter.parse(value);
        } catch (ParseException e) {
            // Bad date so return null
            Log log = LogFactory.getLog(GenericTypeValidator.class);
            if (log.isDebugEnabled()) {
                log.debug("Date parse failed value=[" + value  + "], " +
                                           "locale=[" + locale + "] "  + e);
            }
        }

        return date;
View Full Code Here

Examples of org.apache.commons.logging.Log

        try {
            value = PropertyUtils.getProperty(bean, property);

        } catch(IllegalAccessException e) {
            Log log = LogFactory.getLog(ValidatorUtils.class);
            log.error(e.getMessage(), e);
        } catch(InvocationTargetException e) {
            Log log = LogFactory.getLog(ValidatorUtils.class);
            log.error(e.getMessage(), e);
        } catch(NoSuchMethodException e) {
            Log log = LogFactory.getLog(ValidatorUtils.class);
            log.error(e.getMessage(), e);
        }

        if (value == null) {
            return null;
        }
View Full Code Here

Examples of org.apache.commons.logging.Log

        }
    }

    private void logEnvInfo() {
       try {
          Log log = LogFactory.getLog(Log4jService.class);
          log.info("----------------------------------------------");
          log.info("Started Logging Service");
          log.debug("Log4jService created with configFileName=" + this.configurationFile +
                    ", refreshPeriodSeconds=" + this.refreshPeriod);
          log.info("Runtime Information:");
          log.info("  Install Directory = " + DirectoryUtils.getGeronimoInstallDirectory().toString());
          log.info("  JVM in use = " + System.getProperty("java.vendor") + " Java " + System.getProperty("java.version"));
          log.info("Java Information:");
          log.info("  System property [java.runtime.name]  = " + System.getProperty("java.runtime.name"));
          log.info("  System property [java.runtime.version]  = " + System.getProperty("java.runtime.version"));
          log.info("  System property [os.name]             = " + System.getProperty("os.name"));
          log.info("  System property [os.version]          = " + System.getProperty("os.version"));
          log.info("  System property [sun.os.patch.level]  = " + System.getProperty("sun.os.patch.level"));
          log.info("  System property [os.arch]             = " + System.getProperty("os.arch"));
          log.info("  System property [java.class.version]  = " + System.getProperty("java.class.version"));
          log.info("  System property [locale]              = " + System.getProperty("user.language") + "_" + System.getProperty("user.country"));
          log.info("  System property [unicode.encoding]    = " + System.getProperty("sun.io.unicode.encoding"));
          log.info("  System property [file.encoding]       = " + System.getProperty("file.encoding"));
          log.info("  System property [java.vm.name]        = " + System.getProperty("java.vm.name"));
          log.info("  System property [java.vm.vendor]      = " + System.getProperty("java.vm.vendor"));
          log.info("  System property [java.vm.version]     = " + System.getProperty("java.vm.version"));
          log.info("  System property [java.vm.info]        = " + System.getProperty("java.vm.info"));
          log.info("  System property [java.home]           = " + System.getProperty("java.home"));
          log.info("  System property [java.classpath]      = " + System.getProperty("java.classpath"));
          log.info("  System property [java.library.path]   = " + System.getProperty("java.library.path"));
          log.info("  System property [java.endorsed.dirs]  = " + System.getProperty("java.endorsed.dirs"));
          log.info("  System property [java.ext.dirs]       = " + System.getProperty("java.ext.dirs"));
          log.info("  System property [sun.boot.class.path] = " + System.getProperty("sun.boot.class.path"));
          log.info("----------------------------------------------");
       } catch (Exception e) {
          System.err.println("Exception caught during logging of Runtime Information.  Exception=" + e.toString());
       }
    }
View Full Code Here

Examples of org.apache.commons.logging.Log

   
    public final static String HEADER_LOG_ID = "org.apache.synapse.transport.nhttp.headers";
    public final static String WIRE_LOG_ID = "org.apache.synapse.transport.nhttp.wire";

    public static IOSession decorate(IOSession session, final String id) {
        Log log = LogFactory.getLog(session.getClass());
        Log wirelog = LogFactory.getLog(WIRE_LOG_ID);
        if (wirelog.isDebugEnabled() || log.isDebugEnabled()) {
            session = new LoggingIOSession(log, wirelog, session, id);
        }
        return session;
    }
View Full Code Here

Examples of org.apache.commons.logging.Log

        }
        return session;
    }
   
    public static NHttpClientHandler decorate(NHttpClientHandler handler) {
        Log log = LogFactory.getLog(handler.getClass());
        if (log.isDebugEnabled()) {
            handler = new LoggingNHttpClientHandler(log, handler);
        }
        return handler;
    }
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Log


    @Test
    public void testInverse() {
        final UnivariateFunction inv = new Inverse();
        final UnivariateFunction log = new Log();

        final double lo = 12.34;
        final double hi = 456.78;

        final GaussIntegrator integrator = factory.legendreHighPrecision(60, lo, hi);
        final double s = integrator.integrate(inv);
        final double expected = log.value(hi) - log.value(lo);
        // System.out.println("s=" + s + " e=" + expected);
        Assert.assertEquals(expected, s, 1e-15);
    }
View Full Code Here

Examples of org.apache.commons.scxml.model.Log

            } else if (a instanceof Cancel) {
                Cancel c = (Cancel) a;
                b.append(indent).append("<cancel sendid=\"")
                    .append(c.getSendid()).append("\"/>\n");
            } else if (a instanceof Log) {
                Log lg = (Log) a;
                b.append(indent).append("<log expr=\"").append(lg.getExpr())
                        .append("\"/>\n");
            } else if (a instanceof Exit) {
                Exit e = (Exit) a;
                b.append(indent).append("<exit");
                String expr = e.getExpr();
View Full Code Here

Examples of org.apache.commons.scxml2.model.Log

                writeAV(writer, ATTR_SENDID, c.getSendid());
                writer.writeEndElement();
            } else if (a instanceof Foreach) {
                writeForeach(writer, (Foreach) a);
            } else if (a instanceof Log) {
                Log lg = (Log) a;
                writer.writeStartElement(XMLNS_SCXML, ELEM_LOG);
                writeAV(writer, ATTR_LABEL, lg.getLabel());
                writeAV(writer, ATTR_EXPR, escapeXML(lg.getExpr()));
                writer.writeEndElement();
            } else if (a instanceof Raise) {
                Raise e = (Raise) a;
                writer.writeStartElement(XMLNS_SCXML, ELEM_RAISE);
                writeAV(writer, ATTR_EVENT, e.getEvent());
View Full Code Here

Examples of org.apache.felix.cm.integration.helper.Log

    volatile ExecutorService executor;

    @Test
    public void test_ConcurrentManagedServicesWithConcurrentConfigurations()
    {
        final Log log = new Log(bundleContext);
        log.info("starting test_ConcurrentManagedServicesWithConcurrentConfigurations");
        // Use at least 10 parallel threads, or take all available processors if the running host contains more than 10 processors.
        int parallelism = Math.max(10, Runtime.getRuntime().availableProcessors());
        final ConfigurationAdmin ca = getConfigurationAdmin();
        final ExecutorService executor = Executors.newFixedThreadPool(parallelism);
        try
        {
            int pidCounter = 0;

            long timeStamp = System.currentTimeMillis();
            for (int loop = 0; loop < 1000; loop++)
            {
                log.debug("loop#%d -------------------------", (loop + 1));

                final CountDownLatch managedServiceUpdated = new CountDownLatch(MANAGED_SERVICES);
                final CountDownLatch managedServiceUnregistered = new CountDownLatch(MANAGED_SERVICES);

                // Create some ManagedServices concurrently
                log.info("registering aspects concurrently");
                final CopyOnWriteArrayList<ServiceRegistration> managedServices = new CopyOnWriteArrayList<ServiceRegistration>();
                final CopyOnWriteArrayList<Configuration> confs = new CopyOnWriteArrayList<Configuration>();

                for (int i = 0; i < MANAGED_SERVICES; i++)
                {
                    final String pid = "pid." + i + "-" + (pidCounter++);
                    executor.execute(new Runnable()
                    {
                        public void run()
                        {
                            Hashtable props = new Hashtable();
                            props.put(Constants.SERVICE_PID, pid);

                            ServiceRegistration sr = bundleContext.registerService(
                                ManagedService.class.getName(),
                                new TestManagedService(managedServiceUpdated), props);
                            managedServices.add(sr);
                            try
                            {
                                Configuration c = ca.getConfiguration(pid, null);
                                c.update(new Hashtable()
                                {
                                    {
                                        put("foo", "bar");
                                    }
                                });
                                confs.add(c);
                            }
                            catch (IOException e)
                            {
                                log.error("could not create pid %s", e, pid);
                                return;
                            }
                        }
                    });
                }

                if (!managedServiceUpdated.await(MAXWAIT, TimeUnit.MILLISECONDS))
                {
                    TestCase.fail("Detected errors logged during concurrent test");
                    break;
                }
                log.info("all managed services updated");

                // Unregister managed services concurrently
                log.info("unregistering services concurrently");
                for (final ServiceRegistration sr : managedServices)
                {
                    executor.execute(new Runnable()
                    {
                        public void run()
                        {
                            sr.unregister();
                            managedServiceUnregistered.countDown();
                        }
                    });
                }

                // Unregister configuration concurrently
                log.info("unregistering configuration concurrently");
                for (final Configuration c : confs)
                {
                    c.delete();
                }

                // Wait until managed services have been unregistered
                if (!managedServiceUnregistered.await(MAXWAIT, TimeUnit.MILLISECONDS))
                {
                    TestCase.fail("Managed Servives could not be unregistered timely");
                    break;
                }

                if (log.errorsLogged())
                {
                    TestCase.fail("Detected errors logged during concurrent test");
                    break;
                }

                log.info("finished one test loop");
                if ((loop + 1) % 100 == 0)
                {
                    long duration = System.currentTimeMillis() - timeStamp;
                    System.out.println(String.format("Performed %d tests in %d ms.", (loop + 1), duration));
                    timeStamp = System.currentTimeMillis();
                }
            }
        }

        catch (Throwable t)
        {
            Assert.fail("Test failed: " + t.getMessage());
        }

        finally
        {
            shutdown(executor);
            log.close();
        }
    }
View Full Code Here

Examples of org.apache.flume.channel.file.Log

        channel.put(event);
      }
      tx.commit();
      tx.close();
    }
    Log log = field("log")
      .ofType(Log.class)
      .in(channel)
      .get();

    Assert.assertTrue("writeCheckpoint returned false",
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.