<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>logging from a jsp page</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=10927884" />
  <subtitle>logging from a jsp page</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=10927884</id>
  <updated>2026-04-08T01:44:14Z</updated>
  <dc:date>2026-04-08T01:44:14Z</dc:date>
  <entry>
    <title>RE: logging from a jsp page</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118312629" />
    <author>
      <name>Enrique Valdes Lacasa</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118312629</id>
    <updated>2020-01-21T20:55:07Z</updated>
    <published>2020-01-21T20:55:07Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Using LIferay&amp;nbsp;7.2.1-ga2 CE I was able to do it the following way:&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;% Log _log = LogFactoryUtil.getLog("/jsp/module_name/view.jsp"); %&amp;amp;gt;
&lt;/code&gt;&lt;/pre&gt;So I just used the path in the module under:&amp;nbsp;&lt;span style="color: #212529"&gt;&lt;span style="font-family: SFMono-Regular, Menlo, Monaco, Consolas, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace"&gt;&lt;span style="font-size: 14px;"&gt;MODULE-ROOT/src/main/resources/META-INF/resources/...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;Hope it helps!&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Enrique Valdes Lacasa</dc:creator>
    <dc:date>2020-01-21T20:55:07Z</dc:date>
  </entry>
  <entry>
    <title>RE: logging from a jsp page</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10935542" />
    <author>
      <name>Greg Amerson</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10935542</id>
    <updated>2011-09-29T00:58:02Z</updated>
    <published>2011-09-29T00:58:02Z</published>
    <summary type="html">Can you attach your full copy of your jsp source so we can see the import statements at the top?  Thanks.</summary>
    <dc:creator>Greg Amerson</dc:creator>
    <dc:date>2011-09-29T00:58:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: logging from a jsp page</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10933424" />
    <author>
      <name>Patrick da Silva</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10933424</id>
    <updated>2011-09-28T19:35:05Z</updated>
    <published>2011-09-28T19:35:05Z</published>
    <summary type="html">Hi,&lt;br /&gt;The error is &amp;#34;An error occured at line: 49 in the jsp file:../test.jsp page cannot be resolved to a type&amp;#34;&lt;br /&gt;&lt;br /&gt;49: &amp;lt;%! public static Log log = LogFactoryUtil.getLog(test.class); %&amp;gt;&lt;br /&gt;&lt;br /&gt;Stacktrace&lt;br /&gt;Error [IncludeTag:154] org.apache.jasper.JasperException: Unable to compile class for JSP&lt;br /&gt;&lt;br /&gt;Thanks</summary>
    <dc:creator>Patrick da Silva</dc:creator>
    <dc:date>2011-09-28T19:35:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: logging from a jsp page</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10927949" />
    <author>
      <name>saravanan muniraj</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10927949</id>
    <updated>2011-09-28T13:54:18Z</updated>
    <published>2011-09-28T13:54:18Z</published>
    <summary type="html">please provide entire error messages, by the way , check  whether have you mentioned correct class name</summary>
    <dc:creator>saravanan muniraj</dc:creator>
    <dc:date>2011-09-28T13:54:18Z</dc:date>
  </entry>
  <entry>
    <title>logging from a jsp page</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10927883" />
    <author>
      <name>Patrick da Silva</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=10927883</id>
    <updated>2011-09-28T13:44:03Z</updated>
    <published>2011-09-28T13:44:03Z</published>
    <summary type="html">Hi,&lt;br /&gt;I&amp;#39;m very new to Liferay...(very new).  I just started work on a project that uses Liferay CE 6.0.6 w/Apache Tomcat and I have been tasked with writing things to the server via log4j from a jsp page.  I&amp;#39;m not sure if this can be done but what we want to do is capture some information when the user submits a comment.  After researching a few things I tried to do the following but had no success.  Can you log from a jsp page, do I have to do it from a portlet, create an ext?  I also tried adding the code below in a separate java class and then tried to reference my methods from this other class but that didn&amp;#39;t work&lt;br /&gt;&lt;br /&gt;In my test.jsp page&lt;br /&gt;&lt;br /&gt;Import the following statements&lt;br /&gt;import com.liferay.portal.kernel.log.Log;&lt;br /&gt;import com.liferay.portal.kernel.log.LogFactoryUtil;&lt;br /&gt;&lt;br /&gt;&amp;lt;%!&lt;br /&gt;private static Log log = LogFactoryUtil.getLog(MyClass.class);&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;//write to server log here&lt;br /&gt;//inside some method&lt;br /&gt;log.info(&amp;#34;Some Error Message&amp;#34;);&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;The errors I get is that private static Log Log = LogFactoryUtil.getLog(test.class) cannot be resolved to a type&lt;br /&gt;Any help would be great&lt;br /&gt;&lt;br /&gt;Thanks</summary>
    <dc:creator>Patrick da Silva</dc:creator>
    <dc:date>2011-09-28T13:44:03Z</dc:date>
  </entry>
</feed>
