logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Cheshire" <cheshira...@gmail.com>
Subject Re: smtpappender not working in jboss
Date Fri, 16 Jun 2006 07:49:24 GMT
Sorry, here is the Wiki entry.

http://wiki.jboss.org/wiki/Wiki.jsp?page=Log4jRepositorySelector

Yes all other logging works perfectly fine. Everything, regardless of
log level, goes to the "mycategoryname" appender without a problem.

Regardless of whether I use the version of log4j that came with JBoss
(4.0.3SP1) or replace it with 1.2.13, it does this.

Chris

On 6/15/06, Jacob Kjome <hoju@visi.com> wrote:
>
> How about a link to the repository selector in the JBoss Wiki?
>
> Also, can we assume that you are using the logger "mycategoryname" to
> do the ERROR and FATAL logging?  Does all other log appending work
> properly with the repository selector?
>
>
> Jake
>
> At 01:20 PM 6/15/2006, you wrote:
>  >I have configured log4j to write app logs using the RepositorySelector
>  >found in the JBoss Wiki, and it is working just fine. I have tried to
>  >add an email appender to the configuration to email me the error &
>  >fatal messages and they are not getting sent. The log file contains
>  >the errors, but no email is ever generated (I checked the mail server
>  >logs, and nothing is ever being received).
>  >
>  >The config is as follows:
>  >
>  ><?xml version="1.0" encoding="UTF-8"?>
>  ><log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
>  >debug="true">
>  >    <appender name="dailyLogFile"
>  >class="org.apache.log4j.DailyRollingFileAppender">
>  >        <param name="File" value="${log4j.log.dir}/myapp.log"/>
>  >        <layout class="org.apache.log4j.PatternLayout">
>  >            <param name="ConversionPattern" value="%d %-5p [%c{1}] - %m%n"/>
>  >        </layout>
>  >    </appender>
>  >
>  >    <appender name="email" class="org.apache.log4j.net.SMTPAppender">
>  >        <param name="From" value="someemailaddress" />
>  >        <param name="To" value="myemailaddress" />
>  >        <param name="SMTPHost" value="mymailhost" />
>  >        <param name="Subject" value="webapp error" />
>  >        <layout class="org.apache.log4j.PatternLayout">
>  >            <param name="ConversionPattern"
>  >value="[%d]%n%n%-5p%n%n%c%n%n%m%n%n" />
>  >        </layout>
>  >        <filter class="org.apache.log4j.varia.LevelRangeFilter">
>  >            <param name="LevelMin" value="ERROR"/>
>  >            <param name="LevelMax" value="FATAL"/>
>  >        </filter>
>  >    </appender>
>  >
>  >    <category name="mycategoryname">
>  >        <priority value="DEBUG"/>
>  >        <appender-ref ref="dailyLogFile"/>
>  >        <appender-ref ref="email" />
>  >    </category>
>  >
>  >    <category name="anothercategoryname">
>  >        <priority value="DEBUG" />
>  >        <appender-ref ref="dailyLogFile" />
>  >    </category>
>  >
>  >    <root>
>  >        <priority value="WARN"/>
>  >        <appender-ref ref="STDOUT"/>
>  >    </root>
>  ></log4j:configuration>
>  >
>  >I just wrote a very simple java app (not web app) that uses the same
>  >config and writes an error and fatal log, and they both get mailed
>  >fine, so it appears the configuration is ok.
>  >
>  >I have posted this on JBoss forums but have had no luck there. Can
>  >anyone offer me some help here?
>  >
>  >Thanks,
>  >
>  >Chris
>  >
>  >---------------------------------------------------------------------
>  >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>  >For additional commands, e-mail: log4j-user-help@logging.apache.org
>  >
>  >
>  >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message