Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-40732

Using LogFactoryUtil and defining a custom log file in portal-log4j.xml is not working in plugins

    Details

      Description

      I define a FileAppender to create the file mylog.log (where the log messages of my portlet must be saved). The problem is that mylog.log is never created by Liferay.

      In my portal-log4j.xml (inside my plugin) I have:

      portal-log4j.xml
      ...
      <param name="FileNamePattern" value="@liferay.home@/logs/mylog.log" />
      ...
      

      And in my portlet I have:

      NewPortlet.java
      ...
      private static final Log LOG = LogFactoryUtil.getLog(NewPortlet.class);
      ...
      LOG.info("MY_LOG2");
      ...
      

      In the console I see the message "16:13:23,695 INFO [http-bio-8080-exec-5][NewPortlet:117] MY_LOG2" but no mylog.log file is created.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 40 weeks, 1 day ago

                Packages

                Version Package
                6.2.0 CE M2