|
|
Sponsor |
Re: Logging for Different Packages: msg#00066apache.logging.log4cxx.user
On Dec 17, 2004, at 1:10 AM, Manish Moorjani wrote: Hi All, You asked a log4j question on the log4cxx-user mailing list with a message that contained several hundred lines of list subscription fluff and HTML email. Not a great start. You should read "A short intro to log4j" at http://logging.apache.org/log4j/docs/manual.html The quick answer is that you define two file appenders in your configuration, call the backend and frontend and associate each with a corresponding logger with a configuration file like: log4j.logger.Abc.bdc.frontend=info, frontend log4j.appender.frontend=org.apache.log4j.FileAppender log4j.appender.frontend.layout=org.apache.log4j.PatternLayout log4j.appender.frontend.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.frontend.File=frontend.log log4j.additivity.frontend=false log4j.rootLogger=info, backend log4j.appender.backend=org.apache.log4j.FileAppender log4j.appender.backend.layout=org.apache.log4j.PatternLayout log4j.appender.backend.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.backend.File=frontend.log With this configuration, any logging request submitted to a logger that has a name starting with "Abc.bdc.frontend." will be logged to the frontend.log file. It won't go to backend.log since the loggers additivity is false. Any other logging request, will go the backend.log. // would be appended to frontend.log Logger.getLogger("Abc.bdc.frontend.someclass").info("Some Message"); // would be appended to backend.log Logger.getLogger("Abc.bdc.backend.someclass").info("Some Message");
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Removing trailing semicolon for namespaces., Tommi Maekitalo |
|---|---|
| Next by Date: | log4cxx - Default Initialization Procedure - is implemented somewhere?, mgr Jan Obdrzalek |
| Previous by Thread: | Logging for Different Packages, Manish Moorjani |
| Next by Thread: | log4cxx - Default Initialization Procedure - is implemented somewhere?, mgr Jan Obdrzalek |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive 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 |
Home | sitemap
| advertise | OSDir is
an inevitable website.
|