Log4net, how to log a verbose message?

前端 未结 6 849
醉酒成梦
醉酒成梦 2020-12-14 09:53

I can log info messages without a problem, but can\'t figure out how to log verbose messages. Any help would be welcomed.

My problem is:

loggingEvent.Level

6条回答
  •  借酒劲吻你
    2020-12-14 10:45

    I've tested log4net with BasicConfigurator, and writing log messages generated output for all levels from EMERGENCY down to DEBUG, but not for TRACE or VERBOSE.

    I needed to execute the code below for them to start logging.

    var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
    ((Hierarchy)logRepository).Root.Level = Level.All;
    

提交回复
热议问题