Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

level problem: msg#00000

apache.logging.log4cxx.user

Subject: level problem

I am also finding a significant performance penalty when including DEBUG level statements even though this level is not enabled, and therefore have to comment out log4cxx code out of frequently run areas.

 

Any ideas on how I can fix this?

 

Thanks.

 


From: Anita Banerji [mailto:Anita.Banerji@xxxxxxxxxxxxxxxxxxxxxxxxx]
Sent: 18 October 2007 09:11
To: log4cxx-user@xxxxxxxxxxxxxxxxxx
Subject: level problem

 

Hi,

 

I wish to print out variable values within my code at the various different logging levels. However, debug level statements are printed when there are also info level statements within the same function. I’d appreciate any advice on how to prevent this happening.

 

With the level set to INFO in the config file: log4j.logger.ImageVolume=INFO I would not expect to see the debug level output: “generateImage: xMax:  ok”.

 

Thank you,

 

Anita

 

Output:

 

INFO  ImageVolume - creating a new image volume

INFO  ImageVolume - generateImage: no noise added

INFO  ImageVolume - generateImage: mapping to image

INFO  ImageVolume - generateImage: xMax:  okgenerateImage: complete

 

 

In ImageVolume.h

 

class ImageVolume

{

            static log4cxx::LoggerPtr logger;

            shared_ptr<logstream> outstream;

 

            …

};

 

In ImageVolume.cc

 

LoggerPtr ImageVolume::logger(Logger::getLogger("ImageVolume"));

 

ImageVolume::ImageVolume(shared_ptr<TissueToVoxelMap> tissueToVoxelMap)

{

            shared_ptr<logstream> log(new logstream(logger, Level::OFF));

            outstream= log;

            *outstream << Level::INFO << "creating a new image volume " << LOG4CXX_ENDMSG;

 

            …

}

 

void ImageVolume::generateImage(shared_ptr<SignalProduction> signalProduction,

                                                            shared_ptr<TissueToVoxelMap> tissueToVoxelMap, shared_ptr<Noise> noise)

{

            *(outstream.get()) << Level::INFO << "generateImage: no noise added " << LOG4CXX_ENDMSG;

 

            shared_ptr< map<TISSUETYPE, SIGNAL_INTENSITY> > tissueToSignalMap= signalProduction->generateSignalForAllTissues();

 

            unsigned xMax= image->getDimX();

            unsigned yMax= image->getDimY();

            unsigned zMax= image->getDimZ();

 

            *(outstream.get()) << Level::INFO << "generateImage: mapping to image" << LOG4CXX_ENDMSG;

            *outstream << Level::DEBUG << "generateImage: xMax: " << xMax << " ok" << LOG4CXX_ENDMSG;

 

            …

           

            *(outstream.get()) << Level::INFO << "generateImage: complete" << LOG4CXX_ENDMSG;

}

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
solaris.opensol...    editors.vim/200...    web.turbogears....    jakarta.ant.dev...    mathematics.max...    text.unicode.ge...    lang.ruby.core/...    xfce.announce/2...    network.centeri...    php.cvs.pear/20...    user-groups.lin...    kde.devel.quant...    file-systems.ar...    redhat.fedora.t...    apple.fink.auto...    gnome.orbit.gen...    qplus.devel/200...    culture.transpo...    video.dri.user/...    operators.nanog...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation