-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
greggwon edited this page May 31, 2013
·
5 revisions
The configuration of .Net applications is different than Java, because we don't have the convenience of -Djava.util.logging.config.file=mylogging.properties kinds of command line things. This package recognizes several different ways of configuring logging.
- The environment variables
netlog.logging.config.classandnetlog.logging.config.assemblycan be set in the system environment variables to specify a class whose constructor will do all the appropriate initialization. - The environment variable
netlog.logging.config.filecan specify the name of a properties file, which acts very much like thejava.util.logging.config.filecontents allows, to specify logging configuration.
Any application, can of course use the Logger, Handler and LogManager classes to explicitly manage the logging configuration at any point in time. To put a system wide EventLogHandler into play, code can do things like:
Logger.GetLogger("").AddHandler( new EventLogHandler() );
to add the EventLogHandler to the top level Logger so that it can also log appropriate events (based on its Level setting), to the System Event Log.