Skip to content

Commit

Permalink
Update log4net.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiranAvidov authored Jun 23, 2022
1 parent 5e2e190 commit 1a8f672
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions docs/log4net.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ If you want to change some of the fields or add some of your own, inherit the ap
```C#
public class MyAppLogzioAppender : LogzioAppender
{
protected override void ExtendValues(LoggingEvent loggingEvent, Dictionary<string, string> values)
{
values["logger"] = "MyPrefix." + values["logger"];
values["myAppClientId"] = new ClientIdProvider().Get();
}
protected override void ExtendValues(LoggingEvent loggingEvent, Dictionary<string, string> values)
{
values["logger"] = "MyPrefix." + values["logger"];
values["myAppClientId"] = new ClientIdProvider().Get();
}
}
```

Expand All @@ -132,23 +132,23 @@ using System.Reflection;

namespace dotnet_log4net
{
class Program
{
static void Main(string[] args)
{
var logger = LogManager.GetLogger(typeof(Program));
var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

// Replace "App.config" with the config file that holds your log4net configuration
XmlConfigurator.Configure(logRepository, new FileInfo("App.config"));

logger.Info("Now I don't blame him 'cause he run and hid");
logger.Info("But the meanest thing he ever did");
logger.Info("Before he left was he went and named me Sue");

LogManager.Shutdown();
}
}
class Program
{
static void Main(string[] args)
{
var logger = LogManager.GetLogger(typeof(Program));
var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

// Replace "App.config" with the config file that holds your log4net configuration
XmlConfigurator.Configure(logRepository, new FileInfo("App.config"));

logger.Info("Now I don't blame him 'cause he run and hid");
logger.Info("But the meanest thing he ever did");
logger.Info("Before he left was he went and named me Sue");

LogManager.Shutdown();
}
}
}
```

Expand Down

0 comments on commit 1a8f672

Please sign in to comment.