I would like to combine both rolling time and rolling size in an appender, it seems there is no composite rolling in log4cxx, am I right ?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
No, there isn't. In fact, there is no such combined policy implemented in log4j, either, so it was not transferred to log4cxx.
I once had a task of writing such mixed-policy rolling file appender (in log4j, though). I did this by overriding
FileAppender
, esp. the methodto continue logging to the appropriate log chunk after process restart, and
to test after every log entry whether the condition for rolling over is true.
A truly powerful feature of implementing your own appender in log4j/cxx is that you can define its properties in
log4j.properties
and have them set by the library. In Java you get it for free, thanks to reflection; in log4cxx you only need to write yourmethod, where you iterate through option strings and perform necessary initialization actions.
Hope that helps and comes in the right time.