Hi,
I am probably missing something but...
If your ApplicationClasses run in separate VM instances
from each other, you could configure the category/appender
relationship at runtime using the Category class static methods.
Once, at the beginning of your "application class" use the
Category methods like setPriority() and addAppender()
to set the logging state of the  utility classes that it will call.

For Example:
Assuming you had a predefined appender for BetaCalc called
BCFileAppender.  You could try this at the beginning of BetaCalc:
Category catVP =
Category.getInstance("swissrisk.databaseLayer.VolatilityPeer");
Appender appBC =
Category.getAppender("BCFileAppender");
catVP.addAppender(appBC);

// Now instantiate and call VolatilityPeer methods.

Hope this helps...
- Joe

-----Original Message-----
From: Roland Röder <[EMAIL PROTECTED]>
To: Log4j-User (E-Mail) <[EMAIL PROTECTED]>
Date: Friday, September 21, 2001 10:59 AM
Subject: WG: need help with category structure


>Hi,
>
>I'm very sad about getting no response on my question. This is a serious
>problem for me. I need only a hint, what to do. Can someone help me,
please?
>
>
>regard,
>roland
>
>-----Ursprüngliche Nachricht-----
>Von: Roland Röder [mailto:[EMAIL PROTECTED]]
>Gesendet: Freitag, 14. September 2001 10:56
>An: Log4j-User (E-Mail)
>Betreff: need help with category structure
>
>
>Hi,
>
>I need a suggestion "how to structure categories".
>My application consists of different classes in different packages like
>
>Utility classes:
>swissrisk.databaseLayer.VolatilityPeer
>swissrisk.common.IOUtilities
>
>Application classes:
>swissrisk.requestdispatcher.RequestDispatcherServlet
>swissrisk.requestdispatcher.XMLReader
>swissrisk.volatility.VolatilityCalc
>swissrisk.beta.BetaCalc
>
>The application classes consists of servlets and standalone modules and
uses
>the utility classes. Each of the application classes
>(RequestDispatcherServlet, VolatilityCalc, BetaCalc) should have a separate
>logfile (this can be easily achieved using the categories
>swissrisk.requestdispatcher.RequestDispatcherServlet,
>swissrisk.volatility.VolatilityCalc, swissrisk.beta.BetaCalc and assigning
>different logfiles in the configuration file). My goal is, that the utility
>classes logs in the same logfile as the calling application. The utility
>classes consists of many static methods and I don't want to pass the
>category on every method call.
>Is there an easy way for this approach? Can I use NDC to solve my problem?
>
>Thanks for help
>_______________________________________
>Roland Röder tel: +41 1 455 70 00
>Swissrisk AG fax: +41 1 455 70 01
>Räffelstrasse 32 mobile: +49 174 3279432
>8045 Zürich mail: [EMAIL PROTECTED]
>Switzerland home: www.swissrisk.com
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to