Re: Messages in a Loop

2005-05-27 Thread Antoine TYNEVEZ
Hi Ivan, I think you could do like this : class A { Logger loggerA = Logger.getLogger(A.class.getName()); boolean doLogging = true; void loop { while (true) { // some logix ... // some verification if (condition && doLogging) { loggerA.error("xxx"); // error msg doLogg

Re: Messages in a Loop

2005-05-25 Thread Ivan Linhares Martins
James, It should work with any loop, like this: class A { Logger loggerA = Logger.getLogger(A.class.getName()); void loop { while (true) { // some logix ... // some verification if (condition) { loggerA.error("xxx"); // error msg } // sleep for a while... } }

RE: Messages in a Loop

2005-05-24 Thread Aron Bock
From: Ivan Linhares Martins <[EMAIL PROTECTED]> Reply-To: Ivan Linhares Martins <[EMAIL PROTECTED]> To: log4j-user@logging.apache.org Subject: Messages in a Loop Date: Tue, 24 May 2005 15:56:08 -0300 Hi, I´m using log4j version 1-3 alpha 6, working with Socket and File Appender

Re: Messages in a Loop

2005-05-24 Thread James Stauffer
Any loop or one specific loop? If it is one specific loop you could configure the logger that it uses. On 5/24/05, Ivan Linhares Martins <[EMAIL PROTECTED]> wrote: > Hi, > > I´m using log4j version 1-3 alpha 6, working with Socket and File Appenders. > > I would like to know if i can prevent re

Messages in a Loop

2005-05-24 Thread Ivan Linhares Martins
Hi, I´m using log4j version 1-3 alpha 6, working with Socket and File Appenders. I would like to know if i can prevent repeated messages generated in a loop appearing in files or remote receivers only by configuring Log4j, i.e. not writing additional code. Is it possible? Thanks, Ivan