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

  • Home
  • SEARCH
  • 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 788871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:26:06+00:00 2026-05-14T21:26:06+00:00

I created a new Logger object like this: log4cplus::Logger m_WebAccessLogger; //a class member Then

  • 0

I created a new Logger object like this:

log4cplus::Logger m_WebAccessLogger;  //a class member

Then in the constructor initialization list I do:

m_WebAccessLogger(log4cplus::Logger::getInstance("WebAccess")

This works fine, it logs as expected. What I’m having trouble with is, I want to configure the log4cplus.properties file so that everything for “WebAccess” will go to a separate log file (right now it goes to the default log file where everything else goes).

I can’t seem to find the documentation for how to configure these properties files, so I need help please!

Here’s my current log properties, how can I tell it to have “WebAccess” go to a different file?

log4cplus.rootLogger=DEBUG, ROLLING
log4cplus.appender.STDOUT=log4cplus::ConsoleAppender
log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout
log4cplus.appender.STDOUT.layout.ConversionPattern=%d{%m/%d/%y %H:%M:%S} [%t] %-5p %c{2} %%%x%% - %m [%l]%n
log4cplus.appender.STDOUT.layout.ConversionPattern=%d{%H:%M:%S} [%t] - %m%n

log4cplus.appender.ROLLING=log4cplus::RollingFileAppender
log4cplus.appender.ROLLING.MaxFileSize=5MB
log4cplus.appender.ROLLING.MaxBackupIndex=5
#log4cplus.appender.ROLLING.layout.ConversionPattern=%d{%m/%d/%y %H:%M:%S} [%t] %-5p %c{2} %%%x%% - %m [%l]%n
log4cplus.appender.ROLLING.layout=log4cplus::TTCCLayout
log4cplus.appender.ROLLING.File=c:\projects\ArchiveService\IArchive.log

Something like:
WebAccess.File=c:\projects\ArchiveService\webaccess.log
or
log4cplus.WebAccess.File=webaccess.log

I know log4cplus is simular to log4j, that why I put that as a Tag for this one.

  • 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-14T21:26:06+00:00Added an answer on May 14, 2026 at 9:26 pm

    I figured it out by guessing.

    log4cplus.rootLogger=DEBUG, ROLLING
    log4cplus.appender.STDOUT=log4cplus::ConsoleAppender
    log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout
    log4cplus.appender.STDOUT.layout.ConversionPattern=%d{%m/%d/%y %H:%M:%S} [%t] %-5p %c{2} %%%x%% - %m [%l]%n
    log4cplus.appender.STDOUT.layout.ConversionPattern=%d{%H:%M:%S} [%t] - %m%n
    
    log4cplus.appender.ROLLING=log4cplus::RollingFileAppender
    log4cplus.appender.ROLLING.MaxFileSize=5MB
    log4cplus.appender.ROLLING.MaxBackupIndex=5
    #log4cplus.appender.ROLLING.layout.ConversionPattern=%d{%m/%d/%y %H:%M:%S} [%t] %-5p %c{2} %%%x%% - %m [%l]%n
    log4cplus.appender.ROLLING.layout=log4cplus::TTCCLayout
    log4cplus.appender.ROLLING.File=c:\projects\ArchiveService\Debug\ImageArchive.log
    
    log4cplus.logger.WebAccess=DEBUG, R2
    log4cplus.appender.R2=log4cplus::RollingFileAppender
    log4cplus.appender.R2.File=c:\projects\ArchiveService\Debug\webaccess.log
    log4cplus.appender.R2.MaxFileSize=5MB
    log4cplus.appender.R2.MaxBackupIndex=5
    #log4cplus.appender.R2.layout=log4cplus::TTCCLayout
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have created a new List View Style that shows thumbnails from a picture
This is happening on Vista. I created a new dialog based MFC project to
Does a new SessionFactor y and Session object have to be created for each
I created a new SharePoint portal for testing purposes using a manually added HOSTS
I created a new email box for general support questions. When I try to
I've just created a new Windows XP VM on my Mac using VMware Fusion.
I've created a new C++ project in Visual Studio 2008. No code has been
I have created a new solution with a minimal amount of code that represents
I m new to use ankhSVN and having issues. I have created some new
I am new to Windows Mobile and created an app that needs to do

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.