我已经为日志创建了一个单独的控制台应用程序,然后将单个控制台dll添加到多个用于日志记录的应用程序。只要我运行应用程序,它就可以正常记录,但也会显示以下错误
log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The config
我们使用带有log4net核心的.NET库在文件中写入日志。但是,在执行应用程序"log4net:ERROR ConfigureFromXml,带有null 'element‘参数“时,我们会得到这个错误。以下是我们的Program.cs文件:
public class Program
{
public static void Main(string[] args)
{
XmlDocument log4netConfig = new XmlDocument();
log4netConfig.Load(File.OpenRead(&
我有一个写log4net日志的C#可执行文件。如果我直接运行这个exe,日志记录就可以正常工作。但是,如果我从F#脚本(扩展名为fsx)调用exe,则会出现以下错误
log4net:ERROR Failed to find configuration section 'log4net' in the application'
s .config file. Check your .config file for the <log4net> and <configSections> e
lements. The configuration sect
我正在尝试将log4net记录器实现到我的基于application.file的WPF登录,而不是为我工作。
我读过很多其他的问题和答案,但我还没能解决.这就是我遇到的错误:
log4net:ERROR Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration s
这是我的错误信息:
log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" t
我正在尝试为log4net创建一个Helper类,它会将我的所有消息记录到日志文件中。
该解决方案由一个MVC Web应用程序和2个Windows服务组成。我希望能够在所有三个项目中使用相同的记录器类。
我正在创建的帮助类在一个公共项目中。
这就是这门课的样子:
public class TBLogger
{
private static ILog Logger;
public ILog Log
{
get
{
if (Logger != null) return Logger;
Xml
我正在尝试使用Log4net XMLLayout输出日志文件读取Log4View。
<?xml version="1.0"?>
<log4net>
<appender name="fileAppender" type="log4net.Appender.FileAppender">
<!-- Note: Be sure that your user has the rights to write to this directory. -->
<file value=
在尝试检索C#中的log4net日志文件路径时,我遇到了这个错误。这是我使用的代码。
Hierarchy hierarchy = LogManager.GetRepository() as Hierarchy; // WORKS FINE
Logger logger = hierarchy.Root; // WORKS FINE
FileAppender appender = logger.Appenders[0] as FileAppender; // ERROR!!! - Index was out of range. Mu