Do you want to keep a count of every unique log message and append that
to the message?
Code:
log.Debug("A");
log.Debug("AB");
log.Debug("ABC");
log.Debug("ABCD");
log.Debug("A");
log.Debug("AB");
log.Debug("ABC");
log.Debug("ABCD");
log.Debug("A");
log.Debug("AB");
log.Debug("ABC");
log.Debug("ABCD");
Output:
A
AB
ABC
ABCD
A - repeated 2 times
AB - repeated 2 times
ABC - repeated 2 times
ABCD - repeated 2 times
A - repeated 3 times
AB - repeated 3 times
ABC - repeated 3 times
ABCD - repeated 3 times
Or do you want to queue up repeated lines and output them when the
repository shuts down?
A - repeated 3 times
AB - repeated 3 times
ABC - repeated 3 times
ABCD - repeated 3 times
If you queue up repeated outputs not only will they potential take up a
lot of memory, but you'd loose all of the time stamp information
associated with a logging event.
- Ron
--- Morten Andersen <[EMAIL PROTECTED]> wrote:
---------------------------------
Hi all!
Can log4net ignore repeated log lines?
log.Debug("Hello world");
log.Debug("Hello world");
log.Debug("Hello world");
log.Debug("Hello world");
log.Debug("Another message");
The log lines above should result in something like this:
Hello world
Last message was repeated 3 times
Another message
--
Best Regards
Morten Andersen
Developer
Vianett AS | [EMAIL PROTECTED] |+47 69 20 69 74 | Skype: mortander