Hi Alex,
Thanks for your guidence and input. but I am new to log4cpp code. i could
not succeeded till now.
If you can provide any test examples or any reference, which i can use to
write sample program for throtting/anti flooding for my requirement.
My requirement,
1) Need to write only single log in to the file (for specific logs), which
are coming with high frequency/ repeatedly / redundant log.
2) Example: in 1 second, 100 same logs are coming and writing in to the
file, want to restrict/write only once in case of redundant log in 1 second.
It would be great help, If you can provide any sample code for my
requirement, for you it would take hardly few minuts.
Another, if i want to add marker into the log, how i can implement...
I can suggest you the following solution if you wish the throttling be the part of logging subsystem:
create custom appender (or logger) class which will keep the logged data in memory and compare it with the data logged next. If test shows they are equal, then discard this message instead of writing it.
However, the same functionality might be implemented separately from the logging subsystem as well. In this case log4cpp would consume only single message which came out of throttler.
Alex.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Need help on logger product - https://sourceforge.net/projects/log4cpp/
Do we have any feature in log4cpp project about log flooding occurance for perticular log?
As in our logger file single log has thousands of occurance, want to restict based on 1 second occurance.
Which causing space issue in our product.
Request you to help on this issue, want to use anti flooding log mechanism in log4cpp product.
Thanks in advance.
Regards,
Girwar Yadav
India
Hi Girwar Yadav
I would suggest you to have a look at the Poco project which have a
string logging subsystem support: https://pocoproject.org/
Le 24/04/2020 à 10:52, Girwar a écrit :
Thanks Francis ANDRE for providing valuable input on this issue, i will
look into this.
Regards,
Girwar Yadav
Mob: +91 9886480632
Mob: +91 8310710417
On Fri, Apr 24, 2020 at 4:02 PM Francis ANDRE francisandre@users.sourceforge.net wrote:
Hello
The loggers do not track the content which comes into appenders. Therefore they have no ability to throttle the message which comes too frequently.
I could suggest to build your own appender which performs the throttling.
Alex.
Last edit: Alexander Perepelkin 2020-04-24
Thanks Alex for your valuable feedback. I will look into this.
Regards,
Girwar Yadav
India
Mob: +91 9886480632
Mob: +91 8310710417
On Fri, Apr 24, 2020 at 4:32 PM Alexander Perepelkin sanchouss_@users.sourceforge.net wrote:
Hi Alex,
Thanks for your guidence and input. but I am new to log4cpp code. i could
not succeeded till now.
If you can provide any test examples or any reference, which i can use to
write sample program for throtting/anti flooding for my requirement.
My requirement,
1) Need to write only single log in to the file (for specific logs), which
are coming with high frequency/ repeatedly / redundant log.
2) Example: in 1 second, 100 same logs are coming and writing in to the
file, want to restrict/write only once in case of redundant log in 1 second.
It would be great help, If you can provide any sample code for my
requirement, for you it would take hardly few minuts.
Another, if i want to add marker into the log, how i can implement...
Thanks in advance.
Regards,
Girwar Yadav
On Fri, Apr 24, 2020 at 4:32 PM Alexander Perepelkin sanchouss_@users.sourceforge.net wrote:
Hi
I can suggest you the following solution if you wish the throttling be the part of logging subsystem:
create custom appender (or logger) class which will keep the logged data in memory and compare it with the data logged next. If test shows they are equal, then discard this message instead of writing it.
However, the same functionality might be implemented separately from the logging subsystem as well. In this case log4cpp would consume only single message which came out of throttler.
Alex.