Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6546839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:45:28+00:00 2026-05-25T11:45:28+00:00

I would like to combine both rolling time and rolling size in an appender,

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:45:28+00:00Added an answer on May 25, 2026 at 11:45 am

    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 method

    // log4j
    void setFile(String fileName, boolean append, boolean bufferedIO, int bufferSize);
    // log4cxx
    void setFile(const LogString& filename, bool append1, bool bufferedIO1, size_t bufferSize1, Pool& p);
    

    to continue logging to the appropriate log chunk after process restart, and

    // log4j
    void subAppend(LoggingEvent event);
    // log4cxx
    virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); 
    

    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 your

    void setOption(const LogString& option, const LogString& value);
    

    method, where you iterate through option strings and perform necessary initialization actions.

    Hope that helps and comes in the right time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 databases that I would like to combine. They both have the
I need to combine two URL's that both contain .Path information. I would like
What I would like to combine both of this below dataframe. > am_R3_1 Group.2
I have two views that I would like to combine into one. The first
I have the following 2 arrays and would like to combine them. I'm more
I have some old C code that I would like to combine with some
In an asp.net application, I would like to combine the use of the Webclient
This is the sequel to this question . I would like to combine three
I would like to send the output from a command to both STDOUT and
I have 2 select statements and would like to combine them so they're displayed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.