question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why does Log4net input require changes to logging code?

See original GitHub issue

As far as I see (all?) input libraries are written in such a way that they can read from their respective inputs without requiring any changes to the existing log writing code. Only log4net input is different. Here we are required to request a logger from a specific logger repository called EventFlowRepo. Existing log4net logging code won’t work, because it typically creates loggers from the default repository.

Why is log4net input implemented in this way? Can it be changed? Can it be used differently so that it behaves like other inputs (i.e. no changes to existing logging code are required).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremysmith1commented, Jan 2, 2019

It is a little fuzzy, but I remember having issues if I did not create a named repository. I don’t think this is necessary, but I am unsure. It was just inexperience on my part I believe.

I will take a deeper look into it over the weekend, if you do not beat me to it.

1reaction
karolz-mscommented, Jan 2, 2019

It should be fairly easy to fix this. One possibility is to make the logging repository name a configuration parameter and use the value of the parameter as part of initialization Default value could be empty, which would be a hint to use the default repository.

@jeremysmith1 was there a particular reason why you used a named repository as the default for log4net input?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Log4net Tutorial for .NET Logging: 14 Best Practices and ...
By adopting a logging framework, it becomes easy to write your logs to different places by simply changing your configuration.
Read more >
Apache log4net: Frequently Asked Questions
log4net categorizes logging into levels: DEBUG, INFO, WARN, ERROR and FATAL. The format of the log output can be easily changed by implementing...
Read more >
Log4net does not write the log in the log file
I have created a simple scenario using Log4net, but it seems that my log appenders do not work because the messages are not...
Read more >
log4net - Frequently Asked Questions - SourceForge
Well one of the clever features of log4net is that you can change the logging configuration while your program is running. If you...
Read more >
Log4net Configuration: Logging Exactly the Way You Want It
This architecture conforms nicely to the theory of separating code from config. It gives you greater flexibility for choosing your log ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found