[Opensim-dev] server consoles

Dünnebeil Gerhard Gerhard.Duennebeil at arcs.ac.at
Fri Oct 5 06:32:32 UTC 2007


Hi.

I'm using log4j, which is the java companion of log4net.

Assuming log4net is working similar they work with the following pattern:

There is a singleton that manages all logging. This is usually well hidden for the common user.
This singleton controls "loggers", which all have a unique name. The standard pattern is to create one static logger for each class. This is important as you can (but not must!) adjust logging attributes for each individual logger.

The individual loggers are responsible for creating and filtering the log output. Having done this, they send it to to zero or more so called "appenders". A lot of handy appenders are available. See http://logging.apache.org/log4net/release/features.html for more.

It is easy (and usually done outside the application in config files) to add new appenders. It is also easy to write new, own appenders as and integrate them. Additionally/alternatively it is possible to influence the configuration programatically, so e.g. making sure there always is an appender available that sends logging to a web interface is an easy task.


I'd strongly vote doing the step to lognet as indicated in the patch and port the rest of the logging after that as it would bring a *lot* of advantages.

Best regards
Gerhard

-----Ursprüngliche Nachricht-----
Von: opensim-dev-bounces at lists.berlios.de [mailto:opensim-dev-bounces at lists.berlios.de] Im Auftrag von Jeff Ames
Gesendet: Freitag, 05. Oktober 2007 04:35
An: opensim-dev at lists.berlios.de
Betreff: Re: [Opensim-dev] server consoles

>  * That we pass the logging interface to each component that should be 
> able to log; ie no global logging singleton (that road has already 
> lead to grief)

This is a bit of a side note, but there is a patch in mantis currently to add log4net support (http://bug.opensecondlife.org/view.php?id=438).  I'm no log4net expert, I believe that you can use the GetLogger static method, and avoid passing global variables around.

Currently in that patch, all the log4net stuff is hidden inside the LogBase class, though, so whatever variable passing was going on is still going on.  This probably wouldn't be too hard to change.  It would kind of hard-code log4net as the only logging option, but perhaps that's okay....

Jeff
_______________________________________________
Opensim-dev mailing list
Opensim-dev at lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev



More information about the Opensim-dev mailing list