I want do something like this:
<script RunAt="server">
private static log4net.ILog _logger = null;
public static log4net.ILog Logger
{ get { return _logger; } }
protected void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
log4net.Config.XmlConfigurator.Configure();
_logger = log4net.LogManager.GetLogger("DtWebLogger");
}
....
</script>
I’m wondering after this I can use the same logger object in every pages.
So, is this possible? or Where can I instant a global instance of a Logger?
Your inited is right and log4net.LogManager.GetLogger already use one instance no need do it again.