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 "Günther, Rene - Innflow AG" <re...@innflow.com> on 2009/08/02 14:40:00 UTC
WG: Only partial logging with log.debug
I got a problem with using log4j. In my class I define the log like this:
protected static final Log log =
LogFactory.getLog(NewDocumentsArrivedJob.class);
One of my calls look like this:
log.debug("Send email to " + user.getUsername()+ " use language " +
user.getLocale().getLocale());
log.debug("Using template " + templateName.trim());
The first appends a line in my logfile, the second call of debug doesnt
append anything. In that class some of log.debug calls are ignored.
I thought, hmm, maybe the compiling doesnt work, but I also changed
existing working log.debug statements (to log something slightly different)
and this change got compiled and I saw the change in my log file.
Any idea where to look at?
Thanks
Rene
AW: WG: Only partial logging with log.debug
Posted by "Günther, Rene - Innflow AG" <re...@innflow.com>.
I just solved it. I was just too dumb to see the error in my code.
If anyone is interested: I was logging the same information twice: at the beginning of the loop and at the end of the loop. Depending on some variable I had a "continue;" statement in the middle. Obviously it run the "continue;" for every step. The log.debug calls after the continue never happened. I just saw the information that has been logged and I thought that was because of my log.debug call at the end of the loop. No, it was because the log.debug call at the beginning of the loop.
Thanks anyway
Rene
-----Ursprüngliche Nachricht-----
Von: Simon Gibbs [mailto:simon.gibbs@cantorva.com]
Gesendet: Sonntag, 2. August 2009 15:05
An: Log4J Users List
Betreff: Re: WG: Only partial logging with log.debug
Günther, Rene - Innflow AG wrote:
> The first appends a line in my logfile, the second call of debug
> doesn’t append anything.
>
> Any idea where to look at?
>
What does the third statement do?
If this is the last statement you are expecting and depending on your appender it could be buffered. Try adjusting buffers.
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: WG: Only partial logging with log.debug
Posted by Simon Gibbs <si...@cantorva.com>.
Günther, Rene - Innflow AG wrote:
> The first appends a line in my logfile, the second call of debug doesn’t
> append anything.
>
> Any idea where to look at?
>
What does the third statement do?
If this is the last statement you are expecting and depending on your
appender it could be buffered. Try adjusting buffers.
Simon