Reputation: 7630
I am working on the application where I need logging and filtering feature. I am using c++. I came to know about the log4cxx support logging.
I am getting difficulty in filtering .
I have five fields
I need to store these 5 fields in the log file and filter it as well based on below filtering option. Logging and filtering will be done at run time itself. Once the file size reaches 10 MiB, it will start rewriting the file from the beginning.
Filtering Options
1. MAcID
2. date and time
Filtering can done by filtering either one or both. Result should return all the field in the log file .
Upvotes: 4
Views: 2504
Reputation: 2524
I faced once a similar problem than points 1 and 4. I read log4cxx code and I found a possible solution. A job mate tested the solution and progressed it. His conclusions can be found here.
We asked in the log4cxx mailing list if it was the right solution and this is the answer we got. I hope that helps.
Upvotes: 2
Reputation: 14129
I don't think that log4cxx is the right tools for your task, and I am not really sure if this can be done at all with log4cxx.
You can start with a custom appender and your own log level and your own filter.
Do get it running you need to set a log level do determine which filter field should be used and when ever you change the filter you need to clear the Filters and set a new one.
Then you can extract the log string, search for your filter and let it decide if you want to output the log message or not.
Upvotes: 0