Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-1438

Fix for Liferay Faces Util Logger

    Details

      Description

      com.liferay.faces.util.logging.LoggerDefaultImpl shows wrong caller method in JDK log. It takes place because of log() method of JDK logger use name of methos that has has called the JDK logger. So we can use simple fix by using LogRecord object.

      com.liferay.faces.util.logging.LoggerDefaultImpl

      public void info(String message, Object... arguments) {

      if (isInfoEnabled())

      { Throwable throwable = getThrowable(arguments); this.doLog(java.util.logging.Level.INFO, formatMessage(message, arguments), throwable); }

      }

      private void doLog(Level level, String message, Throwable thr)

      { Throwable stackStource = new Throwable(); StackTraceElement[] stackTrace = stackStource.getStackTrace(); StackTraceElement callerStack = stackTrace[2]; LogRecord logRecord = new LogRecord(level, message); if (thr==null) logRecord.setThrown(thr); logRecord.setSourceClassName(callerStack.getClassName()); logRecord.setSourceMethodName(callerStack.getMethodName()); logger.log(logRecord); }

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                liferay-faces-2.1.1-ga2
                liferay-faces-3.0.1-legacy-ga2
                liferay-faces-3.0.1-ga2
                liferay-faces-3.1.1-ga2
                liferay-faces-3.2.4-ga5