Forums de discussion
Need to configure email sending in log4j
Faris Abdulla, modifié il y a 13 années.
Need to configure email sending in log4j
Regular Member Publications: 183 Date d'inscription: 02/09/09 Publications récentes
Hi friends,
I need to configure sending email when error occurs in the software. I have followed some tutorials in web site. But it did not work in liferay 5.2.3. So is there any setting we need to configure for liferay.
links are:
errors by email
Also
sending email through log4j
I didnt see any reaction after changing the log4j.properties in tomcat server..
Awaiting for your valuable reply.
Thanks,
Faris
I need to configure sending email when error occurs in the software. I have followed some tutorials in web site. But it did not work in liferay 5.2.3. So is there any setting we need to configure for liferay.
links are:
errors by email
Also
sending email through log4j
I didnt see any reaction after changing the log4j.properties in tomcat server..
Awaiting for your valuable reply.
Thanks,
Faris
Raja Nagendra Kumar, modifié il y a 13 années.
RE: Need to configure email sending in log4j
Expert Publications: 484 Date d'inscription: 02/03/06 Publications récentes
Which Log4j.properties have you changed..
For Liferay's log4j to see you changes, you need to follow this link.
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/How+to+configure+the+logs+in+Liferay
Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
For Liferay's log4j to see you changes, you need to follow this link.
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/How+to+configure+the+logs+in+Liferay
Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
Faris Abdulla, modifié il y a 13 années.
RE: Need to configure email sending in log4j
Regular Member Publications: 183 Date d'inscription: 02/09/09 Publications récentes
Hi Raja,
Yes, I gone through this wiki.
I placed my properties in WEB-INF/classes/log4j.properties
But it didn't send any email.
I just follow the tutorial which link mentioned in above post.
Also I tried mentioning the SMTP server authentication in log4j.properties.
log4j.appender.mail.SMTPUsername=User
log4j.appender.mail.SMTPPassword=Pass
Thanks,
Yes, I gone through this wiki.
I placed my properties in WEB-INF/classes/log4j.properties
log4j.rootCategory=INFO, CONSOLE, ERROR
log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender
log4j.appender.MAIL.BufferSize=10
log4j.appender.MAIL.SMTPHost=smtp.gmail.com
log4j.appender.MAIL.From=xxx@gmail.com
log4j.appender.MAIL.to=xxx@gmail.com
log4j.appender.MAIL.Subject=[Dummy] Error Alert
log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout
log4j.appender.MAIL.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
But it didn't send any email.
I just follow the tutorial which link mentioned in above post.
Also I tried mentioning the SMTP server authentication in log4j.properties.
log4j.appender.mail.SMTPUsername=User
log4j.appender.mail.SMTPPassword=Pass
Thanks,
Raja Nagendra Kumar, modifié il y a 13 années.
RE: Need to configure email sending in log4j
Expert Publications: 484 Date d'inscription: 02/03/06 Publications récentes
Raw approach but it should definatly work..
go to \liferay\tomcat-6.0.26\webapps\ROOT\WEB-INF\lib, open the jar file
portal-impl.jar and change the log4j.properties of this jar to contain email config.
Regards,
Nagendra
go to \liferay\tomcat-6.0.26\webapps\ROOT\WEB-INF\lib, open the jar file
portal-impl.jar and change the log4j.properties of this jar to contain email config.
Regards,
Nagendra
Faris Abdulla, modifié il y a 13 années.
RE: Need to configure email sending in log4j
Regular Member Publications: 183 Date d'inscription: 02/09/09 Publications récentes
Hi Raja,
I dont know whats wrong with my settings. I didnt see any actions from my server. Still I didnt receive any email from my server when error happened..
Do I need to give the SMTP email configuration in log4j or it will take the default configuration which I metioned in liferay email settings?
Thanks in advance..
I dont know whats wrong with my settings. I didnt see any actions from my server. Still I didnt receive any email from my server when error happened..
Do I need to give the SMTP email configuration in log4j or it will take the default configuration which I metioned in liferay email settings?
Thanks in advance..
Faris Abdulla, modifié il y a 13 années.
RE: Need to configure email sending in log4j
Regular Member Publications: 183 Date d'inscription: 02/09/09 Publications récentes
Hi Raja,
Finally I got some reactions from the log4j... It gives with exceptions. But anyway it responding..
Now I achieved by creating my own class by extending with SMTPAppender using liferay mail service..
Thanks and regards,
Faris
Finally I got some reactions from the log4j... It gives with exceptions. But anyway it responding..
log4j:ERROR Error occured while sending e-mail notification.
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. z1sm1070354fau.21
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
at javax.mail.Transport.send0(Transport.java:169)
at javax.mail.Transport.send(Transport.java:98)
at org.apache.log4j.net.SMTPAppender.sendBuffer(SMTPAppender.java:330)
at org.apache.log4j.net.SMTPAppender.append(SMTPAppender.java:215)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
at org.apache.log4j.Category.callAppenders(Category.java:206)
at org.apache.log4j.Category.forcedLog(Category.java:391)
at org.apache.log4j.Category.log(Category.java:856)
at com.liferay.portal.log.Log4jLogImpl.error(Log4jLogImpl.java:60)
at com.liferay.portal.kernel.log.LogWrapper.error(LogWrapper.java:79)
at com.evimed.portlet.request_center.action.RequestCenterAction.processAction(RequestCenterAction.java:80)
at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:180)
at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:197)
at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:98)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:57)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:632)
at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:664)
at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:359)
at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:604)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:428)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:195)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:157)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:610)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:848)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:143)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:142)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:140)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:154)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:282)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
.........................
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Now I achieved by creating my own class by extending with SMTPAppender using liferay mail service..
Thanks and regards,
Faris