我正在努力使Log4Net集成在.NET核心应用程序中工作,该应用程序将部署到AppEngine灵活的环境中。我的出发点是中的示例代码。我的代码看起来如下:
using log4net; // resolve Log4net
using log4net.Config; // resolve XmlConfigurator
using System.IO; // resolve FileInfo
using System.Reflection; // resolve Assembly
namespace Test
{
public class PlayWithStackdriverLo
我正试图为我的团队编写一个围绕log4net的简单包装器,但是我无法摆脱我得到的log4net配置错误。
有人能帮帮我吗?
包装器类
namespace Common
{
public enum LogType
{
Info,Warn,Fatal,Error,Debug
}
public class DtntLogger
{
public static string LOG4NET_CONFIG_FILE = "log4net.xml";
public LogType LogType {
我正在尝试使用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=
这是我的错误信息:
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
我有一个在Windows8上实现并运行的应用程序log4net。当我以本地管理员身份登录后运行该应用程序时,将会创建日志;以下是该应用程序的log4net调试条目:
log4net: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
log4net: configuring repository [log4net-default-repository] using file [.\Resources\Configuration\LoggerCo
我有一个写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
我已经为日志创建了一个单独的控制台应用程序,然后将单个控制台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
我有一个.net Core3.1 worker服务用作windows服务。自包含发布在visual studio 2019中失败。
输出:
1>------ Publish started: Project: RineService, Configuration: Release Any CPU ------
1>Detected package downgrade: System.Runtime.InteropServices from 4.3.0 to 4.1.0. Reference the package directly from the project to se