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
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...
}
}
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
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
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