It looks like the logging event contains just 1 line from the exception trace instead of the whole trace!!!
Is this a bug or a feature?
Vlad
Hi all,
I activated SMTP appender to send errors by e-mail, but can't properly configure it. Every time an Exception happens, I receive a lot of e-mails with every e-mail body containing only 1 line of the Exception trace log, like:
[16:49:04,315,STDERR] at com.sybase.jdbc2.jdbc.SybStatement.queryLoop(SybStatement.java:1596)
The reason is not SMTP appender itself, but ASYNC appender. SMTP works as expected (1 e-mail per exception), but when wrapped with ASYNC, it sends 1 line per e-mail. For now I just disabled ASYNC, and am looking into Marc Oesch's proposed solution:
Marc Oesch privat wrote:
> Hello Vladyslav,
>
> Don know whether this still is an issue for you. But your problem is not
> a configuration problem.
> I hav the same problem.
> The reason lies in the conception of the AsyncAppender.
> There is a thread waiting on arriving messages. As soon as a message
> arrives, it gets send out.
> If after sending it finds another thread it sends it. The only
> advantage of asynchappender is that this thread runs in a lower priority.
> However I have posted a very minor change to the feature request web
> page in order to implement what you and I need.
> Basically the first error message gets send immediatly (very likely a
> one liner).
> Then the thread wait for a defineable amount of time in order to collect
> and send subsequent messages together in a single message (often one
> error might triggers a bunch of more messages)
> But so far nobody ever replied or implemented the thing.
> Most probably you have to do it yourself just a few lines. I dont have
> the time currently
>
> here is the page
> http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/Log4jRequestedFeatures
>
> Just the lines >> have to be implemented
> Log4J - AsyncAppender?
> <http://nagoya.apache.org/wiki/apachewiki.cgi?action=edit&id=AsyncAppender>
> - posted by [EMAIL PROTECTED] Additional/optional parameter which
> defines a time (in seconds) to pause after subsequent waves of logEvents
> are released to the Appenders (and if not yet available specifiy the
> size of the circular buffer). In combination with an SMTPAppender this
> avoids to have mail flooding. Events can be grouped in mail messages. In
> my opinion only very small changes need to be done to the AsyncAppender?
> <http://nagoya.apache.org/wiki/apachewiki.cgi?action=edit&id=AsyncAppender>
> like for ex.: Run method in inner class Dispatcher
>
> public void run() {
>
> //Category? <http://nagoya.apache.org/wiki/apachewiki.cgi?action=edit&id=Log4JProjectPages/Category> cat = Category.getInstance(Dispatcher.class.getName());
>
> LoggingEvent? <http://nagoya.apache.org/wiki/apachewiki.cgi?action=edit&id=LoggingEvent> event;
>
> >> long lastCycle = 0L;
>
> while(true) {
> synchronized(bf) {
> if(bf.length() == 0) {
> // Exit loop if interrupted but only if the the buffer is empty.
> if(interrupted) {
> //cat.info("Exiting.");
> break;
> }
> try {
> //LogLog.debug("Waiting for new event to dispatch.");
> bf.wait();
> // wait at least a given amount of time: waitMin. Interesting
> // if the appender are mail or messaging appenders
> // waitMin optional by configuration settings or 0
> // would be usefull to test if buffer is full before waiting more time
>
> >> if((System.currentTimeMillis() - lastCycle)/1000 < waitMin)
> bf.wait(waitMin*1000 -(System.currentTimeMillis()-lastCycle);
>
> } catch(InterruptedException e) {
> LogLog.error("The dispathcer should not be interrupted.");
> break;
> }
> }
>
> ...more lines
>
> if(aai != null && event != null) {
> aai.appendLoopOnAppenders(event);
> }
> }
>
> >> lastCycle = System.currentTimeMillis();
>
> } // while
>
>
> Regards
> Marc
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user