log library: Which one, proved and experienced would you advise?
Hello, the question is in the subject.
Some log libraries exist in C++, Log4cpp, log4cxx, Boost.Log...
But are those libraries widely used in industrial software production?
Thanks for your answers
Re: log library: Which one, proved and experienced would you advise?
Be aware that if your application has time critical sections or high priority threads, that the locking used by most logging libraries can have a detrimental effect on timing, by causing priority inversions when a low priority thread logs.
Ironically, it was after looking at the log files that we discovered that it was the logging that was causing the problem in the first place. :sick:
Re: log library: Which one, proved and experienced would you advise?
Does anyone else have any views on logging libraries?
Re: log library: Which one, proved and experienced would you advise?
I wrote my own logger using regular FILE *s, pthread mutexes. They aren't terribly complicated and writing your own gives you absolute control over what gets logged.
Re: log library: Which one, proved and experienced would you advise?
Indeed implementing its own log lib allows doing exactly what you want.
But what I want is to earn time, and what I don't need is absolute control...
Moreover, I think a proved (because mature and used) library provides
- better efficiency about log system overhead
- better filter options
- easier configuration
- ...
And I also think a log system is not a purpose for a developer (or rarely, maybe for a log library developer), but a tool.
That's why I ask about a library.
Re: log library: Which one, proved and experienced would you advise?
Boost.Log may be a good bet if you want a library that may, in time, be integrated in to the standard C++ libraries.
Re: log library: Which one, proved and experienced would you advise?
Quote:
Originally Posted by
ninja9578
I wrote my own logger using regular FILE *s, pthread mutexes. They aren't terribly complicated and writing your own gives you absolute control over what gets logged.
We wrote our own because of the timing difficulties I mentioned.We devised a low impact way of sending log data to a low priority thread that actually did the logging. Logging sections are enabled via a configuration file, including log levels.