You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Stephen More <st...@gmail.com> on 2008/05/30 19:12:57 UTC
SMTPAppender not send a specific ERROR log
I have configured log4j.xml with a <appender name="email"
class="org.apache.log4j.net.SMTPAppender"> that is emailing out all
ERROR messages except for one specific error.
I have added a MemoryWarningSystem to a tomcat servlet. (
http://www.javaspecialists.eu/archive/Issue092.html )
public void init() throws javax.servlet.ServletException
{
_log.trace( "Executing INIT" );
MemoryWarningSystem.setPercentageUsageThreshold( 0.1 );
mws = new MemoryWarningSystem();
mws.addListener( new MemoryWarningSystem.Listener()
{
public void memoryUsageLow( long usedMemory, long maxMemory )
{
double percentageUsed = ((double) usedMemory) / maxMemory;
_log.error("Memory percentageUsed = " + percentageUsed);
MemoryWarningSystem.setPercentageUsageThreshold( 0.2 );
}
});
}
My file appender shows "2008-05-30 13:01:13,083 ERROR
[MonitorServlet:24] Memory percentageUsed = 0.10273910155216874" but I
get no email. ( I do get other ERROR emails ).
What is the best way I can get this working ?
-Thanks
Steve More
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: SMTPAppender not send a specific ERROR log
Posted by "James A. N. Stauffer" <st...@gmail.com>.
Is it possible that the email appender doesn't see the logs from
MemoryWarningSystem because of being on a different trunk of the
logger tree?
On Fri, May 30, 2008 at 12:12 PM, Stephen More <st...@gmail.com> wrote:
> I have configured log4j.xml with a <appender name="email"
> class="org.apache.log4j.net.SMTPAppender"> that is emailing out all
> ERROR messages except for one specific error.
>
> I have added a MemoryWarningSystem to a tomcat servlet. (
> http://www.javaspecialists.eu/archive/Issue092.html )
>
> public void init() throws javax.servlet.ServletException
> {
> _log.trace( "Executing INIT" );
>
> MemoryWarningSystem.setPercentageUsageThreshold( 0.1 );
>
> mws = new MemoryWarningSystem();
> mws.addListener( new MemoryWarningSystem.Listener()
> {
> public void memoryUsageLow( long usedMemory, long maxMemory )
> {
> double percentageUsed = ((double) usedMemory) / maxMemory;
> _log.error("Memory percentageUsed = " + percentageUsed);
> MemoryWarningSystem.setPercentageUsageThreshold( 0.2 );
> }
> });
> }
>
> My file appender shows "2008-05-30 13:01:13,083 ERROR
> [MonitorServlet:24] Memory percentageUsed = 0.10273910155216874" but I
> get no email. ( I do get other ERROR emails ).
>
> What is the best way I can get this working ?
>
> -Thanks
> Steve More
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
--
James A. N. Stauffer http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org