Package com.liferay.portal.kernel.log

Examples of com.liferay.portal.kernel.log.Log


    Bundle bundle = logEntry.getBundle();

    String symbolicName = StringUtil.replace(
      bundle.getSymbolicName(), StringPool.PERIOD, StringPool.UNDERLINE);

    Log log = LogFactoryUtil.getLog("osgi.logging." + symbolicName);

    String message = logEntry.getMessage();

    ServiceReference<?> serviceReference = logEntry.getServiceReference();

    if (serviceReference != null) {
      message += " " + serviceReference.toString();
    }

    if ((level == LogService.LOG_DEBUG) && log.isDebugEnabled()) {
      log.debug(message, logEntry.getException());
    }
    else if ((level == LogService.LOG_ERROR) && log.isErrorEnabled()) {
      log.error(message, logEntry.getException());
    }
    else if ((level == LogService.LOG_INFO) && log.isInfoEnabled()) {
      log.info(message, logEntry.getException());
    }
    else if ((level == LogService.LOG_WARNING) && log.isWarnEnabled()) {
      log.warn(message, logEntry.getException());
    }
  }
View Full Code Here

TOP

Related Classes of com.liferay.portal.kernel.log.Log

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.