-
1. Re: using commons logging with Log4jService
peterj Apr 29, 2008 2:37 PM (in response to erezharari)What type of application are you trying to log? EJB? Servlet? Portlet?
Please post the changes you made to jboss-log4j.xml. Be sure to enclose the text in code brackets and preview your post (to check the formatting) before submitting it.
(Also, if you are not attmepting to do logging from a portlet then you placed this question in the wrong forum.) -
2. Re: using commons logging with Log4jService
erezharari Apr 30, 2008 12:09 AM (in response to erezharari)Well, it was just a primilinary test using a jsp page that would eventually be used within a portlet.
in log4j.xml i added:<appender name="erez_" class="org.apache.log4j.RollingFileAppender"> <param name="Threshold" value="debug"/> <param name="File" value="${jboss.home}/erez.log"/> <param name="MaxFileSize" value="100KB"/> </appender> <logger name="erez" additivity="true"> <level value="debug"/> <appender-ref ref="erez_"/> </logger>
the file erez.log is indeed created, but no logs are written into it.. -
3. Re: using commons logging with Log4jService
peterj Apr 30, 2008 1:25 PM (in response to erezharari)Your logger name is "erez". Only loggers that are named erez, or are children of erez, will be logged to that log file.
What is the name of the logger you are using in the JSP? -
4. Re: using commons logging with Log4jService
erezharari May 1, 2008 12:34 AM (in response to erezharari)indeed 'erez' with error level
-
5. Re: using commons logging with Log4jService
peterj May 1, 2008 2:01 PM (in response to erezharari)I compared your log setting with one that I have. The thing that is different is the < logger > entry - I don't have one. Instead I have a < category > entry. Unfortunately, I don't have my Log4J book with me so I cannot verify the validity of the < logger > entry. Try replacing it with:
<category name="erez"> <priority value="DEBUG"/> <appender-ref ref="erez_" /> </category>