[Opensource] Controller.getLogger()
Michael Rimov
rimovm at centercomp.com
Fri Nov 1 11:04:41 PST 2002
At 01:28 PM 10/31/2002 -0800, you wrote:
>Expresso has a lot of duplicated code for creating loggers (log4j
>Category's) for each controller.
>
>Now there is a simple superclass method in Controller.java, getLogger(),
>which will create a logger with the name of the subclass on demand. So
>instead of duplicating setupLog() code in each and every Controller you
>write, just do logging like
>
>getLogger().error("blah");
>getLogger().debug("blah");
>
>which will create a logger the first time and reuse it thereafter.
Hi Larry,
This is mainly an FYI so you know about some of the artifacts in the
code. setupLog() was initially created because sometimes objects were
getting created before LogManager was instantiated. This is no longer so
critical so in many cases the code:
private static Logger log = Logger.getLogger("blah");
is sufficient now. [Especially in the 5.1 release branch].
>p.s. Mike, I added a 5.1 release tag to the changelog; let me know if this
>was inappropriate
Not at all! You simply beat me to it! Thanks!
-Mike
More information about the Opensource
mailing list