Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • This question is almost word-for-word duplicate of your previous question, which you just deleted. Why didn't you edit it instead? Commented Nov 19, 2017 at 21:57
  • @amon what I've learned in all this years on SE sites... delete, rewrite, reask mostly works better then any edit. Commented Nov 20, 2017 at 5:11
  • I'm rather surprised that file name isn't included in your logging. Is "Event" just the function name? If not, I'd log that as well. But it looks like you're going to create an application whose primary job is to create gigabytes of logging. Anything else it does will be a handy side-effect. And don't assume that the place where the application detected an error is the place where the error actually occurred. You might be wading through vast numbers of "success" lines to find where it really went wrong. Commented Nov 20, 2017 at 8:46
  • @SimonB actually there is a file name, I have added it just a few hours ago and did not update the question yet... there are additional colums, CallerMemberName, CallerLineNumber and CallerFilePath that the C# compiler provides for free. The event does not necesserily have to be a method name. It can be any checkpoint like ApplicationStart. Sure, there should be a lot of Successes ;-) As one of the answers about logging said: disk-space is cheep so I'd rather log too much then spend hours debugging the application to tell someone that he's forgotten the business rules. Commented Nov 20, 2017 at 8:51
  • 2
    Adding a hierarchy to logs is a reasonable thing; Log4J (and, I would expect, Log4Net) have the Nested Diagnostic Context and Mapped Diagnostic Context for just that purpose. But to make that useful, you'll probably also want a better tool for searching your logs, such as the ELK stack. Commented Nov 20, 2017 at 18:53